1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-01-19 05:49:14 +02:00

clippy: fix warnings about useless format call and remove references that would be immediately dereferenced by the compiler.

This commit is contained in:
Matthias Krüger 2017-11-19 17:26:06 +01:00 committed by Andrew Gallant
parent 4d34132365
commit 7ae1f373c2
3 changed files with 4 additions and 4 deletions

View File

@ -601,7 +601,7 @@ impl<'a> ArgMatches<'a> {
if self.is_present("no-line-number") || self.is_present("count") {
false
} else {
let only_stdin = paths == &[Path::new("-")];
let only_stdin = paths == [Path::new("-")];
(atty::is(atty::Stream::Stdout) && !only_stdin)
|| self.is_present("line-number")
|| self.is_present("column")

View File

@ -397,7 +397,7 @@ impl<W: WriteColor> Printer<W> {
self.line_number(line_number, b'-');
}
if self.max_columns.map_or(false, |m| end - start > m) {
self.write(format!("[Omitted long context line]").as_bytes());
self.write(b"[Omitted long context line]");
self.write_eol();
return;
}
@ -408,7 +408,7 @@ impl<W: WriteColor> Printer<W> {
}
fn separator(&mut self, sep: &[u8]) {
self.write(&sep);
self.write(sep);
}
fn write_path_sep(&mut self, sep: u8) {

View File

@ -113,7 +113,7 @@ impl<'a, W: WriteColor> BufferSearcher<'a, W> {
#[inline(never)]
pub fn run(mut self) -> u64 {
let binary_upto = cmp::min(10240, self.buf.len());
let binary_upto = cmp::min(10_240, self.buf.len());
if !self.opts.text && is_binary(&self.buf[..binary_upto], true) {
return 0;
}