summaryrefslogtreecommitdiff
path: root/src/index.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-01-19 08:34:15 +0200
committerLars Wirzenius <liw@liw.fi>2021-01-19 08:40:02 +0200
commit7391e26d18eb6833a6191e6359346f3c0c502607 (patch)
treec5610dbbb0e568a878c2e18c01d5aaaef2c7639a /src/index.rs
parent6fa225df872ea63ddeffbc017f30c0eb96feb8ce (diff)
downloadobnam2-7391e26d18eb6833a6191e6359346f3c0c502607.tar.gz
refactor: use ChunkId directly in errors, instead of String
Diffstat (limited to 'src/index.rs')
-rw-r--r--src/index.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/index.rs b/src/index.rs
index fd38611..d527839 100644
--- a/src/index.rs
+++ b/src/index.rs
@@ -189,14 +189,14 @@ mod sql {
eprintln!("lookup: meta={:?}", meta);
metas.push(meta);
} else {
- let err = ObnamError::DuplicateChunk(id.to_string());
+ let err = ObnamError::DuplicateChunk(id.clone());
error!("{}", err);
return Err(err.into());
}
}
if metas.len() == 0 {
eprintln!("lookup: no hits");
- return Err(ObnamError::MissingChunk(format!("{}", id)).into());
+ return Err(ObnamError::MissingChunk(id.clone()).into());
}
let r = metas[0].clone();
Ok(r)