Skip to content

Commit 53d0500

Browse files
committed
clippy lints
1 parent e2fc4b4 commit 53d0500

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

crates/core/src/repository.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1289,9 +1289,10 @@ pub(crate) struct BytesWeighter;
12891289

12901290
impl quick_cache::Weighter<Id, Bytes> for BytesWeighter {
12911291
fn weight(&self, _key: &Id, val: &Bytes) -> u64 {
1292-
// Be cautions out about zero weights!
1293-
u64::try_from(val.len().clamp(1, u64::MAX as usize))
1292+
u64::try_from(val.len())
12941293
.expect("weight overflow in cache should not happen")
1294+
// Be cautions out about zero weights!
1295+
.max(1)
12951296
}
12961297
}
12971298

crates/core/src/vfs/webdavfs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl<P: Debug + Send + Sync + 'static, S: IndexedFull + Debug + Send + Sync + 's
154154
let entries = self.dir_entries_from_path(davpath)?;
155155
let entry_iter = entries.into_iter().map(|e| {
156156
let entry: Box<dyn DavDirEntry> = Box::new(DavFsDirEntry(e));
157-
entry
157+
Ok(entry)
158158
});
159159
let strm: FsStream<Box<dyn DavDirEntry>> = Box::pin(futures::stream::iter(entry_iter));
160160
Ok(strm)

0 commit comments

Comments
 (0)