Closed masta99wrfvsHsa closed 2 years ago
Please format your code using backticks with invention. It's an unreadable mess right now. And please provide a minimal program. There shouldn't need to be anything about reading from stdin to reproduce the problem.
sorry it actually worked.i final binary is in target folder.i used the wrong binary.
below is my code>
use walkdir::WalkDir;
fn main() { println!("Hello, world!"); use std::io::{stdin,stdout,Write}; let mut s=String::new(); print!("Please enter some text: "); let _=stdout().flush(); stdin().read_line(&mut s).expect("Did not enter a correct string"); if let Some('\n')=s.chars().next_back() { s.pop(); } if let Some('\r')=s.chars().next_back() { s.pop(); } println!("You typed:{}",s);
}
my command log> D:\Coding\rust\gnuwin\walkfolders>cargo build Compiling walkfolders v0.1.0 (D:\Coding\rust\gnuwin\walkfolders) Finished dev [unoptimized + debuginfo] target(s) in 13.11s
D:\Coding\rust\gnuwin\walkfolders>cd src
D:\Coding\rust\gnuwin\walkfolders\src>main Hello, world! Please enter some text: D:\Coding\rust\gnuwin You typed: D:\Coding\rust\gnuwin
D:\Coding\rust\gnuwin\walkfolders\src>
(By right it should print src and git directory right?)