Fix stding reading

This commit is contained in:
vodhash 2025-11-01 23:46:32 +01:00
parent 7bf6d62e05
commit 083a594415
2 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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);
}