diff options
author | Alexander Batischev <eual.jp@gmail.com> | 2021-07-21 20:45:32 +0300 |
---|---|---|
committer | Alexander Batischev <eual.jp@gmail.com> | 2021-07-21 20:45:32 +0300 |
commit | 500c06609b2408fed801840983e261fd87b15ebe (patch) | |
tree | c2e57abeb08a2ea3db4e5b7cd5494fc1544efe0c /src/genlist.rs | |
parent | df5d50b2c2fe705de059d9ea983ce21ca49ed132 (diff) | |
download | obnam2-500c06609b2408fed801840983e261fd87b15ebe.tar.gz |
In errors, store chunk ids as `ChunkId`, not `String`
Fixes #114.
Diffstat (limited to 'src/genlist.rs')
-rw-r--r-- | src/genlist.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/genlist.rs b/src/genlist.rs index 9d7e39d..21f558c 100644 --- a/src/genlist.rs +++ b/src/genlist.rs @@ -8,7 +8,7 @@ pub struct GenerationList { #[derive(Debug, thiserror::Error)] pub enum GenerationListError { #[error("Unknown generation: {0}")] - UnknownGeneration(String), + UnknownGeneration(ChunkId), } impl GenerationList { @@ -42,7 +42,9 @@ impl GenerationList { } }; match gen { - None => Err(GenerationListError::UnknownGeneration(genref.to_string())), + None => Err(GenerationListError::UnknownGeneration(ChunkId::recreate( + genref, + ))), Some(gen) => Ok(gen.id().to_string()), } } |