summaryrefslogtreecommitdiff
path: root/src/client.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-27 11:14:38 +0200
committerLars Wirzenius <liw@liw.fi>2021-03-27 11:14:38 +0200
commit939433798b708d986928a124e81dd03c8488ad90 (patch)
treeb6f1fde5f227c4ddef21838fa3d8b6f56be88b43 /src/client.rs
parent0483cfcc6f85711b7b75fc8f0182e4baf7c0019f (diff)
downloadobnam2-939433798b708d986928a124e81dd03c8488ad90.tar.gz
refactor: drop unnecessary conversions to the same type
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client.rs b/src/client.rs
index 80ae788..d513011 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -245,7 +245,7 @@ impl BackupClient {
debug!("upload_chunk: id={}", chunk_id);
chunk_id.parse().unwrap()
} else {
- return Err(ClientError::NoCreatedChunkId.into());
+ return Err(ClientError::NoCreatedChunkId);
};
info!("uploaded_chunk {} meta {:?}", chunk_id, meta);
Ok(chunk_id)
@@ -264,7 +264,7 @@ impl BackupClient {
debug!("upload_chunk: id={}", chunk_id);
chunk_id.parse().unwrap()
} else {
- return Err(ClientError::NoCreatedChunkId.into());
+ return Err(ClientError::NoCreatedChunkId);
};
info!("uploaded_generation chunk {}", chunk_id);
Ok(chunk_id)
@@ -313,7 +313,7 @@ impl BackupClient {
if res.status() != 200 {
let err = ClientError::ChunkNotFound(chunk_id.to_string());
error!("fetching chunk {} failed: {}", chunk_id, err);
- return Err(err.into());
+ return Err(err);
}
let headers = res.headers();
@@ -321,7 +321,7 @@ impl BackupClient {
if meta.is_none() {
let err = ClientError::NoChunkMeta(chunk_id.clone());
error!("fetching chunk {} failed: {}", chunk_id, err);
- return Err(err.into());
+ return Err(err);
}
let meta = meta.unwrap().to_str()?;
debug!("fetching chunk {}: meta={:?}", chunk_id, meta);
@@ -335,7 +335,7 @@ impl BackupClient {
let err =
ClientError::WrongChecksum(chunk_id.clone(), actual, meta.sha256().to_string());
error!("fetching chunk {} failed: {}", chunk_id, err);
- return Err(err.into());
+ return Err(err);
}
let chunk: DataChunk = DataChunk::new(body);