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();
while let Some(first) = remaining.first().copied() {
if first.contains("::") {
if first.starts_with(':') || first.ends_with(':') || first.contains(":::") {
missing.push(first.to_string());
remaining = remaining[1..].to_vec();
continue;
}
if first.contains("::")
&& !(first.starts_with(':') || first.ends_with(':') || first.contains(":::"))
{
remaining = first
.split("::")
.chain(remaining[1..].iter().copied())