Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions crates/core/flags/hiargs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ impl HiArgs {
builder
.color_specs(self.colors.clone())
.hyperlink(self.hyperlink_config.clone())
.separator(self.path_separator.clone())
.separator(self.path_separator)
.terminator(self.path_terminator.unwrap_or(b'\n'));
builder
}
Expand Down Expand Up @@ -620,7 +620,7 @@ impl HiArgs {
.max_columns(self.max_columns)
.only_matching(self.only_matching)
.path(self.with_filename)
.path_terminator(self.path_terminator.clone())
.path_terminator(self.path_terminator)
.per_match_one_line(true)
.per_match(self.vimgrep)
.replacement(self.replace.clone().map(|r| r.into()))
Expand All @@ -631,7 +631,7 @@ impl HiArgs {
.separator_field_match(
self.field_match_separator.clone().into_bytes(),
)
.separator_path(self.path_separator.clone())
.separator_path(self.path_separator)
.stats(self.stats.is_some())
.trim_ascii(self.trim);
// When doing multi-threaded searching, the buffer writer is
Expand All @@ -658,9 +658,9 @@ impl HiArgs {
.hyperlink(self.hyperlink_config.clone())
.kind(kind)
.path(self.with_filename)
.path_terminator(self.path_terminator.clone())
.path_terminator(self.path_terminator)
.separator_field(b":".to_vec())
.separator_path(self.path_separator.clone())
.separator_path(self.path_separator)
.stats(self.stats.is_some())
.build(wtr)
}
Expand Down
4 changes: 2 additions & 2 deletions crates/printer/src/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ impl SpecValue {
match *self {
SpecValue::None => cspec.clear(),
SpecValue::Fg(ref color) => {
cspec.set_fg(Some(color.clone()));
cspec.set_fg(Some(*color));
}
SpecValue::Bg(ref color) => {
cspec.set_bg(Some(color.clone()));
cspec.set_bg(Some(*color));
}
SpecValue::Style(ref style) => match *style {
Style::Bold => {
Expand Down
6 changes: 3 additions & 3 deletions crates/regex/src/ban.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ pub(crate) fn check(expr: &Hir, byte: u8) -> Result<(), Error> {
match *expr.kind() {
HirKind::Empty => {}
HirKind::Literal(hir::Literal(ref lit)) => {
if lit.iter().find(|&&b| b == byte).is_some() {
if lit.iter().any(|&b| b == byte) {
return invalid();
}
}
HirKind::Class(hir::Class::Unicode(ref cls)) => {
if cls.ranges().iter().map(|r| r.len()).sum::<usize>() == 1 {
let contains =
|r: &&ClassUnicodeRange| r.start() <= ch && ch <= r.end();
if cls.ranges().iter().find(contains).is_some() {
if cls.ranges().iter().any(|r| contains(&r)) {
return invalid();
}
}
Expand All @@ -30,7 +30,7 @@ pub(crate) fn check(expr: &Hir, byte: u8) -> Result<(), Error> {
let contains = |r: &&ClassBytesRange| {
r.start() <= byte && byte <= r.end()
};
if cls.ranges().iter().find(contains).is_some() {
if cls.ranges().iter().any(|r| contains(&r)) {
return invalid();
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/regex/src/strip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn strip_from_match_ascii(expr: Hir, byte: u8) -> Result<Hir, Error> {
Ok(match expr.into_kind() {
HirKind::Empty => Hir::empty(),
HirKind::Literal(hir::Literal(lit)) => {
if lit.iter().find(|&&b| b == byte).is_some() {
if lit.iter().any(|&b| b == byte) {
return invalid();
}
Hir::literal(lit)
Expand Down