From 5b52e6a0269eb2a0c3d69a1ce3312ba07d4dc997 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 27 Aug 2021 16:32:58 +0200 Subject: Fix: Replace unimplemented!() match arm with bail!() Signed-off-by: Matthias Beyer --- src/repository/fs/representation.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/repository') diff --git a/src/repository/fs/representation.rs b/src/repository/fs/representation.rs index d348f7e..5f92ba7 100644 --- a/src/repository/fs/representation.rs +++ b/src/repository/fs/representation.rs @@ -149,9 +149,7 @@ impl FileSystemRepresentation { return Ok(curr_hm.values().count() == 1 || !toml_files_in_tree(curr_hm)) }, Some(Element::Dir(hm)) => curr_hm = hm, - None => { - unimplemented!() - }, + None => anyhow::bail!("Path component '{:?}' was not loaded in map, this is most likely a bug", elem), } } @@ -189,9 +187,7 @@ impl FileSystemRepresentation { curr_path = curr_path.join(elem.dir_name().unwrap()); // unwrap safe by above match curr_hm = hm; } - None => { - unimplemented!() - }, + None => anyhow::bail!("Path component '{:?}' was not loaded in map, this is most likely a bug", elem), } } -- cgit v1.2.3