Skip to content

Commit cfb11d1

Browse files
committed
feat(api): move HardlinkList to hardlink
1 parent 5f94924 commit cfb11d1

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/app.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ use std::{io::stdin, time::Duration};
2020
use sysinfo::Disks;
2121

2222
#[cfg(unix)]
23-
use crate::get_size::{GetBlockCount, GetBlockSize};
23+
use crate::{
24+
get_size::{GetBlockCount, GetBlockSize},
25+
hardlink::HardlinkList,
26+
};
2427

2528
/// The main application.
2629
pub struct App {
@@ -216,11 +219,11 @@ impl App {
216219
SizeGetter::Reporter: crate::reporter::Reporter<SizeGetter::Size>,
217220
{
218221
type Hook = hook::RecordHardlink<'static, Self::Size>;
219-
fn create_hook(record: &'static hook::HardlinkList<Self::Size>) -> Self::Hook {
222+
fn create_hook(record: &'static HardlinkList<Self::Size>) -> Self::Hook {
220223
hook::RecordHardlink::new(record)
221224
}
222-
fn init_hardlink_record() -> &'static hook::HardlinkList<Self::Size> {
223-
hook::HardlinkList::new().pipe(Box::new).pipe(Box::leak)
225+
fn init_hardlink_record() -> &'static HardlinkList<Self::Size> {
226+
HardlinkList::new().pipe(Box::new).pipe(Box::leak)
224227
}
225228
}
226229

src/app/sub.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ where
192192
DataTree<OsStringDisplay, Size>: Send,
193193
Size: size::Size + Sync,
194194
{
195-
type HardlinkRecord = &'a hook::HardlinkList<Size>;
196-
type DeduplicationReport = &'a hook::HardlinkList<Size>;
195+
type HardlinkRecord = &'a crate::hardlink::HardlinkList<Size>;
196+
type DeduplicationReport = &'a crate::hardlink::HardlinkList<Size>;
197197

198198
fn deduplicate_hardlink_sizes(
199199
data_tree: &mut DataTree<OsStringDisplay, Size>,

src/hardlink.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
pub mod hardlink_list;
12
pub mod link_path_list;
23

4+
pub use hardlink_list::HardlinkList;
35
pub use link_path_list::LinkPathList;

src/hook.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,4 @@ impl<Size, Reporter> Hook<Size, Reporter> for DoNothing {
4141
#[cfg(unix)]
4242
pub mod record_hardlink;
4343
#[cfg(unix)]
44-
pub use record_hardlink::HardlinkList;
45-
#[cfg(unix)]
4644
pub use record_hardlink::RecordHardlink;

src/hook/record_hardlink.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
pub mod storage;
2-
3-
pub use storage::HardlinkList;
4-
51
use super::{Hook, HookArgument};
62
use crate::{
3+
hardlink::HardlinkList,
74
inode::InodeNumber,
85
reporter::{event::HardlinkDetection, Event, Reporter},
96
size,

0 commit comments

Comments
 (0)