Merge pull request #1510 from garlic-hub/clippy
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Clean up clippy warnings
authored by Tavian Barnes · committed by GitHub · parents 3b2fd15, 0788c43 · Browse files · 4 files·+6 added−6 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+6 added−6 removed
- other:+6 added−6 removed
Provenance
- Commit
4efc05e- Tree
f62fc24- Author
Tavian Barnes <tavianator@tavianator.com>- Committer
GitHub <noreply@github.com>- Parent 1
3b2fd15- Parent 2
0788c43
4 files changed+6 added−6 removed
modified:src/exec/token.rs+1 added-1 removed
39 unmodified lines40 let mut tokens = Vec::new();41 let mut remaining = input;42 let mut buf = String::new();43 let placeholders = PLACEHOLDERS.get_or_init(|| {44- AhoCorasick::new(&["{{", "}}", "{}", "{/}", "{//}", "{.}", "{/.}"]).unwrap()44+ AhoCorasick::new(["{{", "}}", "{}", "{/}", "{//}", "{.}", "{/.}"]).unwrap()45 });46 while let Some(m) = placeholders.find(remaining) {47 match m.pattern().as_u32() {48 0 | 1 => {50 unmodified linesmodified:src/dir_entry.rs+1 added-1 removed
111 unmodified lines112 113 impl PartialOrd for DirEntry {114 #[inline]115 fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {116- self.path().partial_cmp(other.path())116+ Some(self.cmp(other))117 }118 }119 120 impl Ord for DirEntry {35 unmodified linesmodified:src/regex_helper.rs+1 added-1 removed
14 unmodified lines15 fn hir_has_uppercase_char(hir: &Hir) -> bool {16 use regex_syntax::hir::*;17 18 match hir.kind() {19- HirKind::Literal(Literal(bytes)) => match std::str::from_utf8(&bytes) {19+ HirKind::Literal(Literal(bytes)) => match std::str::from_utf8(bytes) {20 Ok(s) => s.chars().any(|c| c.is_uppercase()),21 Err(_) => bytes.iter().any(|b| char::from(*b).is_uppercase()),22 },23 HirKind::Class(Class::Unicode(ranges)) => ranges82 unmodified linesmodified:src/walk.rs+3 added-3 removed
248 unmodified lines249 }250 251 /// Output a path.252 fn print(&mut self, entry: &DirEntry) -> Result<(), ExitCode> {253- output::print_entry(&mut self.stdout, entry, &self.config);253+ output::print_entry(&mut self.stdout, entry, self.config);254 255 if self.interrupt_flag.load(Ordering::Relaxed) {256 // Ignore any errors on flush, because we're about to exit anyway257 let _ = self.flush();154 unmodified lines412 413 // This will be set to `Some` if the `--exec` argument was supplied.414 if let Some(ref cmd) = config.command {415 if cmd.in_batch_mode() {416- exec::batch(rx.into_iter().flatten(), cmd, &config)416+ exec::batch(rx.into_iter().flatten(), cmd, config)417 } else {418 let out_perm = Mutex::new(());419 420 thread::scope(|scope| {4 unmodified lines425 let rx = rx.clone();426 427 // Spawn a job thread that will listen for and execute inputs.428 let handle = scope429- .spawn(|| exec::job(rx.into_iter().flatten(), cmd, &out_perm, &config));429+ .spawn(|| exec::job(rx.into_iter().flatten(), cmd, &out_perm, config));430 431 // Push the handle of the spawned thread into the vector for later joining.432 handles.push(handle);433 }239 unmodified lines