Replace split_n(2, ...)
with split_once
(#344)
This commit is contained in:
parent
d05bcba02c
commit
5aa543a6c2
1 changed files with 1 additions and 6 deletions
|
@ -12,12 +12,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
}
|
}
|
||||||
let entries = args[2..]
|
let entries = args[2..]
|
||||||
.iter()
|
.iter()
|
||||||
.map(|arg| {
|
.map(|arg| arg.split_once(':').unwrap())
|
||||||
let mut splits = arg.splitn(2, ':');
|
|
||||||
let slug = splits.next().unwrap();
|
|
||||||
let input_path = splits.next().unwrap();
|
|
||||||
(slug, input_path)
|
|
||||||
})
|
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
build_nav(&entries, &args[1])
|
build_nav(&entries, &args[1])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue