diff --git a/src/appstate.rs b/src/appstate.rs index 04ac109..dbec49b 100644 --- a/src/appstate.rs +++ b/src/appstate.rs @@ -55,7 +55,7 @@ impl FileState { ) -> sharry::Result { match self { FileState::C(checked) => { - let endpoint = &uri.endpoint(format!("alias/upload/{}/files/tus", share_id)); + let endpoint = &uri.endpoint(format!("alias/upload/{share_id}/files/tus")); checked.start_upload(http, endpoint, alias_id) } FileState::U(uploading) => Ok(uploading), diff --git a/src/file/chunk.rs b/src/file/chunk.rs index bf57c93..838e66b 100644 --- a/src/file/chunk.rs +++ b/src/file/chunk.rs @@ -23,7 +23,7 @@ impl<'t> Chunk<'t> { // BOOKMARK this might **panic** on platforms where `usize` has more than 64 bit. // Also, you've allocated more than 2 EiB ... in ONE chunk. // Whoa! Maybe just chill? - u64::try_from(len).unwrap_or_else(|e| panic!("usize={} did not fit into u64: {}", len, e)) + u64::try_from(len).unwrap_or_else(|e| panic!("usize={len} did not fit into u64: {e}")) } pub fn get_patch_uri(&self) -> &str { diff --git a/src/sharry/api.rs b/src/sharry/api.rs index 2b5ddb5..9f51932 100644 --- a/src/sharry/api.rs +++ b/src/sharry/api.rs @@ -18,7 +18,7 @@ impl Uri { } pub fn endpoint(&self, endpoint: impl fmt::Display) -> String { - let uri = format!("{}/{}", self, endpoint); + let uri = format!("{self}/{endpoint}"); debug!("endpoint: {uri:?}"); uri diff --git a/src/sharry/client.rs b/src/sharry/client.rs index 8c32799..e857faa 100644 --- a/src/sharry/client.rs +++ b/src/sharry/client.rs @@ -102,7 +102,7 @@ impl Client for ureq::Agent { .post(endpoint) .header("Sharry-Alias", alias_id) .send_empty() - .map_err(|e| ClientError::req_err(e))?; + .map_err(ClientError::req_err)?; trace!("{endpoint:?} response: {res:?}"); ClientError::res_check_status(res.status(), ureq::http::StatusCode::OK)?; @@ -110,7 +110,7 @@ impl Client for ureq::Agent { let res = res .body_mut() .read_json::() - .map_err(|e| ClientError::res_parse_err(e))?; + .map_err(ClientError::res_parse_err)?; debug!("{res:?}");