mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-05-19 09:40:22 -07:00
ripgrep: small cleanups
This commit is contained in:
parent
87a627631c
commit
7eaaa04c69
@ -41,10 +41,10 @@ mod search;
|
|||||||
mod subject;
|
mod subject;
|
||||||
mod unescape;
|
mod unescape;
|
||||||
|
|
||||||
pub type Result<T> = ::std::result::Result<T, Box<::std::error::Error>>;
|
type Result<T> = ::std::result::Result<T, Box<::std::error::Error>>;
|
||||||
|
|
||||||
pub fn main() {
|
fn main() {
|
||||||
match Args::parse().and_then(run) {
|
match Args::parse().and_then(try_main) {
|
||||||
Ok(true) => process::exit(0),
|
Ok(true) => process::exit(0),
|
||||||
Ok(false) => process::exit(1),
|
Ok(false) => process::exit(1),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
@ -54,7 +54,7 @@ pub fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run(args: Args) -> Result<bool> {
|
fn try_main(args: Args) -> Result<bool> {
|
||||||
use args::Command::*;
|
use args::Command::*;
|
||||||
|
|
||||||
match args.command()? {
|
match args.command()? {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user