#Minigrep
Just wrapped up another Rust project—Minigrep, a command-line file search tool! Feeling accomplished and excited for the next challenge!
😇 If you’re learning Rust, I highly recommend tackling this—it’s a great way to level up!
#RustLang #Coding #SystemsProgramming #LearningRust #Minigrep #DevJourney
June 8, 2025 at 1:29 PM
How do I display only test classes where tests exist?
Another followup, I am following the book Developing the Library’s Functionality with Test Driven Development - The Rust Programming Language and copied their source code. My directory structure is this: src/ - bin/ -- lib.rs -main.rs Cargo.toml #Cargo.toml [package] name = "minigrep" version = "0.1.0" edition = "2024" [dependencies] # lib.rs # the only place where I use #[cfg(test)] and #[test] #... #[cfg(test)] mod tests { use crate::Config; #[test] fn test_build_config() { let file_path = "censoredpath/Rust/Tutorials/minigrep/searchfile"; let minigrep_path = "censoredpath/Rust/Tutorials/minigrep/"; let search_text = "keyword"; let args = [String::from(minigrep_path), String::from(file_path)]; assert_eq!(Config::build(&args), Err("Not enough arguments.")); } } Again I get test output for non existing test classes, can you explain why and how to omit this? Finished `test` profile [unoptimized + debuginfo] target(s) in 0.20s Running unittests src/lib.rs (target/debug/deps/minigrep-6189184d8e53aca1) running 1 test test tests::test_build_config ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Running unittests src/bin/main.rs (target/debug/deps/main-b307b7a86dbfe662) running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Doc-tests minigrep running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
users.rust-lang.org
June 4, 2025 at 7:38 AM
🦀 Want to see it in action? We'll print out the command-line arguments and use them in our minigrep project to search for a string in a file. Stay tuned for more updates!

#RustLang #CommandLine #ProgrammingTutorial
March 12, 2024 at 6:21 PM
🦀 Start by creating a new project with `cargo new minigrep`. We'll learn how to effectively handle command-line arguments in this project.

🦀 Rust provides `std::env::args()` to read command-line arguments. It returns an iterator of the arguments passed to our program.
March 12, 2024 at 6:20 PM