1
1
mirror of https://github.com/casey/just.git synced 2024-11-22 10:26:26 +03:00

Fix clippy lints (#2347)

This commit is contained in:
Casey Rodarmor 2024-09-06 14:45:45 -07:00 committed by GitHub
parent da17424b96
commit 6957b2e97f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 11 deletions

View File

@ -15,7 +15,7 @@ impl<'line> Shebang<'line> {
.next()
.unwrap_or("")
.trim()
.splitn(2, |c| c == ' ' || c == '\t');
.splitn(2, [' ', '\t']);
let interpreter = pieces.next().unwrap_or("");
let argument = pieces.next();
@ -33,7 +33,7 @@ impl<'line> Shebang<'line> {
pub fn interpreter_filename(&self) -> &str {
self
.interpreter
.split(|c| matches!(c, '/' | '\\'))
.split(['/', '\\'])
.last()
.unwrap_or(self.interpreter)
}

View File

@ -120,16 +120,18 @@ impl Subcommand {
if let Err(err @ (Error::UnknownRecipe { .. } | Error::UnknownSubmodule { .. })) = result {
search = search.search_parent_directory().map_err(|_| err)?;
let new_parent = starting_parent
.strip_prefix(search.justfile.parent().unwrap())
.unwrap()
.components()
.map(|_| path::Component::ParentDir)
.collect::<PathBuf>()
.join(search.justfile.file_name().unwrap());
if config.verbosity.loquacious() {
eprintln!("Trying {}", new_parent.display());
eprintln!(
"Trying {}",
starting_parent
.strip_prefix(search.justfile.parent().unwrap())
.unwrap()
.components()
.map(|_| path::Component::ParentDir)
.collect::<PathBuf>()
.join(search.justfile.file_name().unwrap())
.display()
);
}
compilation = Self::compile(config, loader, &search)?;