mirror of
https://github.com/tig-pool-nk/tig-monorepo.git
synced 2026-02-21 15:31:26 +08:00
Fix stding reading
This commit is contained in:
parent
7bf6d62e05
commit
083a594415
@ -2,7 +2,7 @@ use anyhow::{anyhow, Result};
|
||||
use clap::{arg, Command};
|
||||
use libloading::Library;
|
||||
use serde_json::{Map, Value, from_str as json_from_str};
|
||||
use std::{fs, panic, path::PathBuf};
|
||||
use std::{fs, io::Read, panic, path::PathBuf};
|
||||
use tig_challenges::*;
|
||||
use tig_structs::core::{BenchmarkSettings, CPUArchitecture, OutputData};
|
||||
use tig_utils::{dejsonify, jsonify};
|
||||
@ -103,7 +103,7 @@ fn main() {
|
||||
let matches = cli().get_matches();
|
||||
let result = if matches.get_flag("stdin") {
|
||||
let mut stdin_content = String::new();
|
||||
if let Err(e) = std::io::Read::read_to_string(&mut std::io::stdin(), &mut stdin_content) {
|
||||
if let Err(e) = std::io::stdin().read_to_string(&mut stdin_content) {
|
||||
eprintln!("Failed to read from stdin: {}", e);
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ fn main() {
|
||||
|
||||
let result = if matches.get_flag("stdin") {
|
||||
let mut stdin_content = String::new();
|
||||
if let Err(e) = std::io::Read::read_to_string(&mut std::io::stdin(), &mut stdin_content) {
|
||||
if let Err(e) = std::io::stdin().read_to_string(&mut stdin_content) {
|
||||
eprintln!("Failed to read from stdin: {}", e);
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user