diff options
author | Florian Klink <flokli@flokli.de> | 2023-12-09T11·21+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-12-09T12·58+0000 |
commit | 22a669d27e6ceeea3ee557fad589fe882064ba44 (patch) | |
tree | e876766c3cd8a6c7bc95085e3fd6ea112f531404 /tvix/castore/src/blobservice | |
parent | 340242174debb0240f642733848688c211532558 (diff) |
refactor(tvix/castore): address clippy r/7140
We match to destructure a single pattern. Change-Id: I564a3510b4860e90b3315a9639effc48ee88b483 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10233 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/castore/src/blobservice')
-rw-r--r-- | tvix/castore/src/blobservice/tests.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tvix/castore/src/blobservice/tests.rs b/tvix/castore/src/blobservice/tests.rs index fe390b537eb8..7480ca808225 100644 --- a/tvix/castore/src/blobservice/tests.rs +++ b/tvix/castore/src/blobservice/tests.rs @@ -217,20 +217,17 @@ fn put_seek(blob_service: impl BlobService) { } // seeking past the end… - match r + // should either be ok, but then return 0 bytes. + // this matches the behaviour or a Cursor<Vec<u8>>. + if let Ok(_pos) = r .seek(io::SeekFrom::Start(fixtures::BLOB_B.len() as u64 + 1)) .await { - // should either be ok, but then return 0 bytes. - // this matches the behaviour or a Cursor<Vec<u8>>. - Ok(_pos) => { - let mut buf: Vec<u8> = Vec::new(); - r.read_to_end(&mut buf).await.expect("must not fail"); - assert!(buf.is_empty(), "expected no more data to be read"); - } - // or not be okay. - Err(_) => {} + let mut buf: Vec<u8> = Vec::new(); + r.read_to_end(&mut buf).await.expect("must not fail"); + assert!(buf.is_empty(), "expected no more data to be read"); } + // or not be okay. // TODO: this is only broken for the gRPC version // We expect seeking backwards or relative to the end to fail. |