Skip to content

Commit e574dc1

Browse files
committed
refactor(client-cli): move ArchiveFormat trait in a dedicated interface.rs sub module
1 parent 28c79ef commit e574dc1

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
use std::path::Path;
2+
3+
use mithril_client::MithrilResult;
4+
5+
/// Trait for supported archive formats (e.g. `.zip`, `.tar.gz`).
6+
#[cfg_attr(test, mockall::automock)]
7+
pub trait ArchiveFormat {
8+
/// Checks whether this format can handle the given archive file.
9+
fn supports(&self, archive_path: &Path) -> bool;
10+
11+
/// Unpacks the archive into the target directory.
12+
fn unpack(&self, archive_path: &Path, unpack_dir: &Path) -> MithrilResult<()>;
13+
}
Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
1+
mod interface;
12
mod tar_gz_unpacker;
23
mod unpacker;
34
mod zip_unpacker;
45

6+
pub use interface::*;
57
pub use unpacker::*;
6-
7-
use mithril_client::MithrilResult;
8-
use std::path::Path;
9-
10-
/// Trait for supported archive formats (e.g. `.zip`, `.tar.gz`).
11-
#[cfg_attr(test, mockall::automock)]
12-
pub trait ArchiveFormat {
13-
/// Checks whether this format can handle the given archive file.
14-
fn supports(&self, archive_path: &Path) -> bool;
15-
16-
/// Unpacks the archive into the target directory.
17-
fn unpack(&self, archive_path: &Path, unpack_dir: &Path) -> MithrilResult<()>;
18-
}

0 commit comments

Comments
 (0)