datastore: clippy fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2022-05-15 16:01:09 +02:00
parent 118e984996
commit ca3f8757ba
4 changed files with 14 additions and 15 deletions

View File

@ -5,11 +5,11 @@ use anyhow::{bail, Error};
use pbs_datastore::DataStore;
fn run() -> Result<(), Error> {
let base: PathBuf = match std::env::args().skip(1).next() {
let base: PathBuf = match std::env::args().nth(1) {
Some(path) => path.into(),
None => bail!("no path passed!\n\nusage: ls-snapshots <path> [<max-depth>]"),
};
let max_depth: Option<usize> = match std::env::args().skip(2).next() {
let max_depth: Option<usize> = match std::env::args().nth(2) {
Some(depth) => match depth.parse::<usize>() {
Ok(depth) if depth < 8 => Some(depth),
Ok(_) => bail!("max-depth must be < 8"),