Skip to content
Myr

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

4 files+6 added−6 removed

modified:src/exec/token.rs+1 added-1 removed
39 unmodified lines
40 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 lines
modified:src/dir_entry.rs+1 added-1 removed
111 unmodified lines
112113impl 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}119120impl Ord for DirEntry {
35 unmodified lines
modified:src/regex_helper.rs+1 added-1 removed
14 unmodified lines
15fn hir_has_uppercase_char(hir: &Hir) -> bool {16 use regex_syntax::hir::*;1718 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)) => ranges
82 unmodified lines
modified:src/walk.rs+3 added-3 removed
248 unmodified lines
249 }250251 /// 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);254255 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 lines
412413 // 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(());419420 thread::scope(|scope| {
4 unmodified lines
425 let rx = rx.clone();426427 // 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));430431 // Push the handle of the spawned thread into the vector for later joining.432 handles.push(handle);433 }
239 unmodified lines