From a84248eca37669addeeabb90ed37a796179c9757 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 30 Apr 2024 07:44:08 +0100 Subject: [PATCH] fix(fs): make FileSystems Clone and Debug --- Cargo.toml | 2 +- src/fs/mod.rs | 1 + src/fs/real.rs | 1 + src/fs/temp.rs | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d84a2db..ff3930c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "kxio" -version = "1.1.1" +version = "1.1.2" edition = "2021" authors = ["Paul Campbell "] description = "Provides injectable Filesystem and Network resources to make code more testable" diff --git a/src/fs/mod.rs b/src/fs/mod.rs index 3b96fc9..16692c5 100644 --- a/src/fs/mod.rs +++ b/src/fs/mod.rs @@ -30,6 +30,7 @@ pub fn temp() -> Result { temp::new().map(FileSystem::Temp) } +#[derive(Clone, Debug)] pub enum FileSystem { Real(real::RealFileSystem), Temp(temp::TempFileSystem), diff --git a/src/fs/real.rs b/src/fs/real.rs index 32b2e4b..cabd979 100644 --- a/src/fs/real.rs +++ b/src/fs/real.rs @@ -4,6 +4,7 @@ pub const fn new(base: PathBuf) -> RealFileSystem { RealFileSystem { base } } +#[derive(Clone, Debug)] pub struct RealFileSystem { base: PathBuf, } diff --git a/src/fs/temp.rs b/src/fs/temp.rs index f0e992d..5e1119b 100644 --- a/src/fs/temp.rs +++ b/src/fs/temp.rs @@ -14,6 +14,7 @@ pub(super) fn new() -> super::Result { }) } +#[derive(Clone, Debug)] pub struct TempFileSystem { real: super::real::RealFileSystem, _temp_dir: Arc>,