mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-25 20:06:53 +00:00
style: corrects the use of ';' to improve readability
- remove unnecessary semicolon and enable lint warning: unnecessary semicolon help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#unnecessary_semicolon - add `;` to the last statement for consitent formatting and enable lint `clippy::semicolon_if_nothing_returned` warning: consider adding a `;` to the last statement for consistent formatting help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.93.0/index.html#semicolon_if_nothing_returned
This commit is contained in:
@@ -660,11 +660,11 @@ mod tests {
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_encrypt_block() {
|
||||
test_block_enc(None).await
|
||||
test_block_enc(None).await;
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_encrypt_block_compressed() {
|
||||
test_block_enc(Some(1)).await
|
||||
test_block_enc(Some(1)).await;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -484,7 +484,7 @@ where
|
||||
iter.next();
|
||||
}
|
||||
_ => (),
|
||||
};
|
||||
}
|
||||
|
||||
while let Some(object) = iter.peek() {
|
||||
if !object.key.starts_with(&query.prefix) {
|
||||
@@ -508,7 +508,7 @@ where
|
||||
ExtractionResult::NoMore => {
|
||||
return Ok(None);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if !server_more {
|
||||
@@ -756,7 +756,7 @@ impl<K: std::cmp::Ord, V> Accumulator<K, V> {
|
||||
None => Some(ExtractionResult::NoMore),
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1069,7 +1069,7 @@ mod tests {
|
||||
assert_eq!(upload, Uuid::from([0x8f; 32]));
|
||||
}
|
||||
_ => panic!("wrong result"),
|
||||
};
|
||||
}
|
||||
|
||||
assert_eq!(acc.keys.len(), 2);
|
||||
assert_eq!(
|
||||
@@ -1098,7 +1098,7 @@ mod tests {
|
||||
match acc.extract(&(query().common), &start, &mut iter) {
|
||||
ExtractionResult::Extracted { key } if key.as_str() == "b" => (),
|
||||
_ => panic!("wrong result"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
@@ -370,7 +370,7 @@ pub async fn handle_complete_multipart_upload(
|
||||
req_part.part_number, req_part.checksum, part.checksum
|
||||
)));
|
||||
}
|
||||
parts.push(*part)
|
||||
parts.push(*part);
|
||||
}
|
||||
_ => return Err(Error::InvalidPart),
|
||||
}
|
||||
|
||||
+4
-4
@@ -192,7 +192,7 @@ pub(crate) async fn save_stream<S: Stream<Item = Result<Bytes, Error>> + Unpin>(
|
||||
meta.checksum = checksums.extract(Some(algo));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
let size = first_block.len() as u64;
|
||||
check_quotas(ctx, size, existing_object.as_ref()).await?;
|
||||
@@ -293,7 +293,7 @@ pub(crate) async fn save_stream<S: Stream<Item = Result<Bytes, Error>> + Unpin>(
|
||||
meta.checksum = checksums.extract(Some(algo));
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Verify quotas are respsected
|
||||
check_quotas(ctx, total_size, existing_object.as_ref()).await?;
|
||||
@@ -339,7 +339,7 @@ pub(crate) async fn check_quotas(
|
||||
let quotas = bucket_params.quotas.get();
|
||||
if quotas.max_objects.is_none() && quotas.max_size.is_none() {
|
||||
return Ok(());
|
||||
};
|
||||
}
|
||||
|
||||
let counters = garage
|
||||
.object_counter_table
|
||||
@@ -436,7 +436,7 @@ pub(crate) async fn read_and_put_blocks<S: Stream<Item = Result<Bytes, Error>> +
|
||||
tracer.start("Hash block (md5, sha256)"),
|
||||
))
|
||||
.await
|
||||
.unwrap()
|
||||
.unwrap();
|
||||
}
|
||||
Err(e) => {
|
||||
block_tx2.send(Err(e)).await?;
|
||||
|
||||
@@ -365,7 +365,7 @@ impl Endpoint {
|
||||
}
|
||||
|
||||
if let Some(message) = query.nonempty_message() {
|
||||
debug!("Unused query parameter: {}", message)
|
||||
debug!("Unused query parameter: {}", message);
|
||||
}
|
||||
Ok((res, Some(bucket)))
|
||||
}
|
||||
@@ -580,7 +580,7 @@ impl Endpoint {
|
||||
pub fn authorization_type(&self) -> Authorization {
|
||||
if let Endpoint::ListBuckets = self {
|
||||
return Authorization::None;
|
||||
};
|
||||
}
|
||||
let readonly = router_match! {
|
||||
@match
|
||||
self,
|
||||
@@ -725,7 +725,7 @@ mod tests {
|
||||
) -> (Endpoint, Option<String>) {
|
||||
let mut req = Request::builder().method(method).uri(uri);
|
||||
if let Some((k, v)) = header {
|
||||
req = req.header(k, v)
|
||||
req = req.header(k, v);
|
||||
}
|
||||
let req = req.body(()).unwrap();
|
||||
|
||||
@@ -859,7 +859,7 @@ mod tests {
|
||||
.body(())
|
||||
.unwrap();
|
||||
|
||||
assert!(Endpoint::from_request(&req, None).is_err())
|
||||
assert!(Endpoint::from_request(&req, None).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user