Skip to content

Commit f0f5747

Browse files
committed
refactor: use 0.into() instead
1 parent 4bfa4ab commit f0f5747

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/app.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ impl App {
205205
impl<SizeGetter> HardlinkDeduplicationSystem<true> for SizeGetter
206206
where
207207
SizeGetter: GetSizeUtils,
208-
SizeGetter::Size: From<u64> + Send + Sync + 'static,
208+
SizeGetter::Size: Send + Sync + 'static,
209+
u64: Into<SizeGetter::Size>, // TODO: remove this line after implementing `Size::ZERO`
209210
{
210211
type Hook = hook::RecordHardLink<'static, Self::Size>;
211212
fn create_hook(record: &'static hook::RecordHardLinkStorage<Self::Size>) -> Self::Hook {

src/app/sub.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ pub trait DeduplicateHardlinkSizes<Size: size::Size> {
190190
impl<'a, Size> DeduplicateHardlinkSizes<Size> for hook::RecordHardLink<'a, Size>
191191
where
192192
DataTree<OsStringDisplay, Size>: Send,
193-
Size: size::Size + From<u64> + Sync,
193+
Size: size::Size + Sync,
194+
u64: Into<Size>, // TODO: replace `0.into()` with `Size::ZERO`
194195
{
195196
type HardlinkRecord = &'a hook::RecordHardLinkStorage<Size>;
196197
type DeduplicationReport = &'a hook::RecordHardLinkStorage<Size>;
@@ -225,7 +226,7 @@ where
225226
Some((*size, links))
226227
})
227228
.fold(
228-
(0, 0, Size::from(0)),
229+
(0, 0, 0.into()),
229230
|(inodes, total_links, total_size), (size, links)| {
230231
(inodes + 1, total_links + links, total_size + size)
231232
},

0 commit comments

Comments
 (0)