From 8001149dba408dbbd06e699792ae41929239a9fa Mon Sep 17 00:00:00 2001 From: WoodenMaiden Date: Tue, 21 Nov 2023 16:46:04 +0100 Subject: [PATCH] revert: remove unnecessary FileHandler Signed-off-by: WoodenMaiden --- agent/lib/src/runner_engine/model.rs | 37 +--------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/agent/lib/src/runner_engine/model.rs b/agent/lib/src/runner_engine/model.rs index 84d3037..47358be 100644 --- a/agent/lib/src/runner_engine/model.rs +++ b/agent/lib/src/runner_engine/model.rs @@ -1,10 +1,4 @@ -use anyhow::Result; -use std::{ - fs::File, - io::{Read, Write}, - path::Path, - path::PathBuf, -}; +use std::path::PathBuf; use serde::{Deserialize, Serialize}; @@ -55,32 +49,3 @@ impl CodeReturn { } } } - -/// A trait responsible for CRU operations on files and dir -/// Mainly used in tests to mock file operations -trait FileHandler: Read + Write { - fn create>(path: P) -> Result - where - Self: Sized; - fn read>(path: P) -> Result - where - Self: Sized; -} - -impl FileHandler for File { - fn create>(path: P) -> Result - where - Self: Sized, - { - let file = File::create(path)?; - Ok(file) - } - - fn read>(path: P) -> Result - where - Self: Sized, - { - let file = File::open(path)?; - Ok(file) - } -}