style: apply rustfmt
Maybe 2024 changes? Note that we now set `edition = "2024"` explicitly in `rustfmt.toml`. Without this, it seems like it's possible in some cases for rustfmt to run under an older edition's style. Not sure how though.
This commit is contained in:
@@ -2,11 +2,10 @@
|
||||
Provides completions for ripgrep's CLI for the fish shell.
|
||||
*/
|
||||
|
||||
use crate::flags::{defs::FLAGS, CompletionType};
|
||||
use crate::flags::{CompletionType, defs::FLAGS};
|
||||
|
||||
const TEMPLATE: &'static str = "complete -c rg !SHORT! -l !LONG! -d '!DOC!'";
|
||||
const TEMPLATE_NEGATED: &'static str =
|
||||
"complete -c rg -l !NEGATED! -n '__rg_contains_opt !LONG! !SHORT!' -d '!DOC!'\n";
|
||||
const TEMPLATE_NEGATED: &'static str = "complete -c rg -l !NEGATED! -n '__rg_contains_opt !LONG! !SHORT!' -d '!DOC!'\n";
|
||||
|
||||
/// Generate completions for Fish.
|
||||
///
|
||||
|
||||
@@ -34,8 +34,7 @@ Register-ArgumentCompleter -Native -CommandName 'rg' -ScriptBlock {
|
||||
}
|
||||
";
|
||||
|
||||
const TEMPLATE_FLAG: &'static str =
|
||||
"[CompletionResult]::new('!DASH_NAME!', '!NAME!', [CompletionResultType]::ParameterName, '!DOC!')";
|
||||
const TEMPLATE_FLAG: &'static str = "[CompletionResult]::new('!DASH_NAME!', '!NAME!', [CompletionResultType]::ParameterName, '!DOC!')";
|
||||
|
||||
/// Generate completions for PowerShell.
|
||||
///
|
||||
|
||||
@@ -10,7 +10,7 @@ use std::{
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use bstr::{io::BufReadExt, ByteSlice};
|
||||
use bstr::{ByteSlice, io::BufReadExt};
|
||||
|
||||
/// Return a sequence of arguments derived from ripgrep rc configuration files.
|
||||
pub fn args() -> Vec<OsString> {
|
||||
|
||||
@@ -22,13 +22,13 @@ use std::{path::PathBuf, sync::LazyLock};
|
||||
use {anyhow::Context as AnyhowContext, bstr::ByteVec};
|
||||
|
||||
use crate::flags::{
|
||||
Category, Flag, FlagValue,
|
||||
lowargs::{
|
||||
BinaryMode, BoundaryMode, BufferMode, CaseMode, ColorChoice,
|
||||
ContextMode, EncodingMode, EngineChoice, GenerateMode, LoggingMode,
|
||||
LowArgs, MmapMode, Mode, PatternSource, SearchMode, SortMode,
|
||||
SortModeKind, SpecialMode, TypeChange,
|
||||
},
|
||||
Category, Flag, FlagValue,
|
||||
};
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -8,7 +8,7 @@ is used when the `--help` flag is given.
|
||||
|
||||
use std::{collections::BTreeMap, fmt::Write};
|
||||
|
||||
use crate::flags::{defs::FLAGS, doc::version, Category, Flag};
|
||||
use crate::flags::{Category, Flag, defs::FLAGS, doc::version};
|
||||
|
||||
const TEMPLATE_SHORT: &'static str = include_str!("template.short.help");
|
||||
const TEMPLATE_LONG: &'static str = include_str!("template.long.help");
|
||||
|
||||
@@ -4,7 +4,7 @@ Provides routines for generating ripgrep's man page in `roff` format.
|
||||
|
||||
use std::{collections::BTreeMap, fmt::Write};
|
||||
|
||||
use crate::flags::{defs::FLAGS, doc::version, Flag};
|
||||
use crate::flags::{Flag, defs::FLAGS, doc::version};
|
||||
|
||||
const TEMPLATE: &'static str = include_str!("template.rg.1");
|
||||
|
||||
|
||||
@@ -169,9 +169,5 @@ fn features() -> Vec<String> {
|
||||
|
||||
/// Returns `+` when `enabled` is `true` and `-` otherwise.
|
||||
fn sign(enabled: bool) -> &'static str {
|
||||
if enabled {
|
||||
"+"
|
||||
} else {
|
||||
"-"
|
||||
}
|
||||
if enabled { "+" } else { "-" }
|
||||
}
|
||||
|
||||
@@ -579,10 +579,10 @@ impl HiArgs {
|
||||
SearchMode::Count => SummaryKind::Count,
|
||||
SearchMode::CountMatches => SummaryKind::CountMatches,
|
||||
SearchMode::JSON => {
|
||||
return Printer::JSON(self.printer_json(wtr))
|
||||
return Printer::JSON(self.printer_json(wtr));
|
||||
}
|
||||
SearchMode::Standard => {
|
||||
return Printer::Standard(self.printer_standard(wtr))
|
||||
return Printer::Standard(self.printer_standard(wtr));
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -809,11 +809,7 @@ impl HiArgs {
|
||||
// When both error, we can't distinguish, so treat as equal.
|
||||
(None, None) => Ordering::Equal,
|
||||
};
|
||||
if sort.reverse {
|
||||
ordering.reverse()
|
||||
} else {
|
||||
ordering
|
||||
}
|
||||
if sort.reverse { ordering.reverse() } else { ordering }
|
||||
});
|
||||
Box::new(with_timestamps.into_iter().map(|(s, _)| s))
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ pub(crate) use crate::flags::{
|
||||
},
|
||||
hiargs::HiArgs,
|
||||
lowargs::{GenerateMode, Mode, SearchMode, SpecialMode},
|
||||
parse::{parse, ParseResult},
|
||||
parse::{ParseResult, parse},
|
||||
};
|
||||
|
||||
mod complete;
|
||||
|
||||
@@ -7,10 +7,10 @@ use std::{borrow::Cow, collections::BTreeSet, ffi::OsString};
|
||||
use anyhow::Context;
|
||||
|
||||
use crate::flags::{
|
||||
Flag, FlagValue,
|
||||
defs::FLAGS,
|
||||
hiargs::HiArgs,
|
||||
lowargs::{LoggingMode, LowArgs, SpecialMode},
|
||||
Flag, FlagValue,
|
||||
};
|
||||
|
||||
/// The result of parsing CLI arguments.
|
||||
|
||||
Reference in New Issue
Block a user