style: rustfmt everything
This is why I was so intent on clearing the PR queue. This will effectively invalidate all existing patches, so I wanted to start from a clean slate. We do make one little tweak: we put the default type definitions in their own file and tell rustfmt to keep its grubby mits off of it. We also sort it lexicographically and hopefully will enforce that from here on.
This commit is contained in:
@@ -7,8 +7,8 @@ use std::io;
|
||||
use std::process;
|
||||
|
||||
use grep_regex::RegexMatcher;
|
||||
use grep_searcher::Searcher;
|
||||
use grep_searcher::sinks::UTF8;
|
||||
use grep_searcher::Searcher;
|
||||
|
||||
fn main() {
|
||||
if let Err(err) = example() {
|
||||
@@ -20,14 +20,18 @@ fn main() {
|
||||
fn example() -> Result<(), Box<dyn Error>> {
|
||||
let pattern = match env::args().nth(1) {
|
||||
Some(pattern) => pattern,
|
||||
None => return Err(From::from(format!(
|
||||
"Usage: search-stdin <pattern>"
|
||||
))),
|
||||
None => {
|
||||
return Err(From::from(format!("Usage: search-stdin <pattern>")))
|
||||
}
|
||||
};
|
||||
let matcher = RegexMatcher::new(&pattern)?;
|
||||
Searcher::new().search_reader(&matcher, io::stdin(), UTF8(|lnum, line| {
|
||||
print!("{}:{}", lnum, line);
|
||||
Ok(true)
|
||||
}))?;
|
||||
Searcher::new().search_reader(
|
||||
&matcher,
|
||||
io::stdin(),
|
||||
UTF8(|lnum, line| {
|
||||
print!("{}:{}", lnum, line);
|
||||
Ok(true)
|
||||
}),
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user