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:
parent
da17424b96
commit
6957b2e97f
@ -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)
|
||||
}
|
||||
|
@ -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)?;
|
||||
|
Loading…
Reference in New Issue
Block a user