1
1
mirror of https://github.com/casey/just.git synced 2024-11-23 11:04:09 +03:00

Refactor invalid path argument check (#1811)

This commit is contained in:
Casey Rodarmor 2023-12-31 16:15:41 -08:00 committed by GitHub
parent f0d4b19557
commit 87925f293e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -226,13 +226,9 @@ impl<'src> Justfile<'src> {
let arena: Arena<Scope> = Arena::new(); let arena: Arena<Scope> = Arena::new();
while let Some(first) = remaining.first().copied() { while let Some(first) = remaining.first().copied() {
if first.contains("::") { if first.contains("::")
if first.starts_with(':') || first.ends_with(':') || first.contains(":::") { && !(first.starts_with(':') || first.ends_with(':') || first.contains(":::"))
missing.push(first.to_string()); {
remaining = remaining[1..].to_vec();
continue;
}
remaining = first remaining = first
.split("::") .split("::")
.chain(remaining[1..].iter().copied()) .chain(remaining[1..].iter().copied())