Skip to content

Commit 28c2f57

Browse files
committed
feat(api)!: replace NonZeroUsize with NonZeroU64
1 parent 53b5d21 commit 28c2f57

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/app/sub.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{
1212
visualizer::{BarAlignment, ColumnWidthDistribution, Direction, Visualizer},
1313
};
1414
use serde::Serialize;
15-
use std::{io::stdout, iter::once, num::NonZeroUsize, path::PathBuf};
15+
use std::{io::stdout, iter::once, num::NonZeroU64, path::PathBuf};
1616

1717
/// The sub program of the main application.
1818
pub struct Sub<Size, SizeGetter, Report>
@@ -35,7 +35,7 @@ where
3535
/// Distribution and number of characters/blocks can be placed in a line.
3636
pub column_width_distribution: ColumnWidthDistribution,
3737
/// Maximum number of levels that should be visualized.
38-
pub max_depth: NonZeroUsize,
38+
pub max_depth: NonZeroU64,
3939
/// [Get the size](GetSize) of files/directories.
4040
pub size_getter: SizeGetter,
4141
/// Reports measurement progress.
@@ -76,7 +76,7 @@ where
7676
reporter: &reporter,
7777
root,
7878
size_getter,
79-
max_depth: max_depth.get() as u64,
79+
max_depth: max_depth.get(),
8080
}
8181
.into()
8282
});
@@ -101,7 +101,7 @@ where
101101
OsStringDisplay::os_string_from("(total)"),
102102
Size::default(),
103103
children,
104-
max_depth.get() as u64,
104+
max_depth.get(),
105105
)
106106
};
107107

src/args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub use threads::Threads;
88

99
use crate::{bytes_format::BytesFormat, visualizer::ColumnWidthDistribution};
1010
use clap::{ColorChoice, Parser};
11-
use std::{num::NonZeroUsize, path::PathBuf};
11+
use std::{num::NonZeroU64, path::PathBuf};
1212
use terminal_size::{terminal_size, Width};
1313
use text_block_macros::text_block;
1414

@@ -105,7 +105,7 @@ pub struct Args {
105105

106106
/// Maximum depth to display the data (must be greater than 0).
107107
#[clap(long, default_value = "10")]
108-
pub max_depth: NonZeroUsize,
108+
pub max_depth: NonZeroU64,
109109

110110
/// Width of the visualization.
111111
#[clap(long, conflicts_with = "column_width")]

0 commit comments

Comments
 (0)