Skip to content

Commit 4c1fde2

Browse files
committed
refactor: remove FormatSizeOutput
1 parent 5c91d8a commit 4c1fde2

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

src/app.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,30 +148,26 @@ impl App {
148148
}
149149
}
150150

151-
trait GetSizeUtils {
152-
type FormatSizeOutput;
153-
fn format_size(bytes_format: BytesFormat) -> Self::FormatSizeOutput;
151+
trait GetSizeUtils: GetSize<Size: size::Size> {
152+
fn format_size(bytes_format: BytesFormat) -> <Self::Size as size::Size>::DisplayFormat;
154153
}
155154

156155
impl GetSizeUtils for GetApparentSize {
157-
type FormatSizeOutput = BytesFormat;
158-
fn format_size(bytes_format: BytesFormat) -> Self::FormatSizeOutput {
156+
fn format_size(bytes_format: BytesFormat) -> BytesFormat {
159157
bytes_format
160158
}
161159
}
162160

163161
#[cfg(unix)]
164162
impl GetSizeUtils for GetBlockSize {
165-
type FormatSizeOutput = BytesFormat;
166-
fn format_size(bytes_format: BytesFormat) -> Self::FormatSizeOutput {
163+
fn format_size(bytes_format: BytesFormat) -> BytesFormat {
167164
bytes_format
168165
}
169166
}
170167

171168
#[cfg(unix)]
172169
impl GetSizeUtils for GetBlockCount {
173-
type FormatSizeOutput = ();
174-
fn format_size(_: BytesFormat) -> Self::FormatSizeOutput {}
170+
fn format_size(_: BytesFormat) {}
175171
}
176172

177173
macro_rules! run {

0 commit comments

Comments
 (0)