From 1230a3ea07706c92b88ef60606f4e91e6f0f3129 Mon Sep 17 00:00:00 2001 From: Steppy Date: Fri, 7 Feb 2025 14:08:38 +0100 Subject: [PATCH] Require Environment to be ShellInterface --- src/environment.rs | 2 +- src/main.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/environment.rs b/src/environment.rs index 6955767..cfe123a 100644 --- a/src/environment.rs +++ b/src/environment.rs @@ -7,7 +7,7 @@ use std::ffi::{OsStr, OsString}; use std::path::PathBuf; use std::{env, io}; -pub trait Environment { +pub trait Environment: ShellInterface { fn args_os(&self) -> Vec; fn var(&self, key: K) -> Result where diff --git a/src/main.rs b/src/main.rs index 05e0ba2..8e3cc84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,13 @@ mod action; mod environment; mod file; +#[cfg(test)] +mod integration_test; mod logger; mod os_str_extension; mod os_string_builder; mod server; mod shell_interface; -#[cfg(test)] -mod integration_test; use crate::action::{Action, FileAction, ServerActions}; use crate::environment::{Environment, Prod}; @@ -16,7 +16,7 @@ use crate::logger::{LogLevel, Logger}; use crate::os_str_extension::OsStrExtension; use crate::os_string_builder::ReplaceWithOsStr; use crate::server::{RelativeLocalPathAnker, ServerAddress}; -use crate::shell_interface::{ScpParam, ServerCommand, ShellCommand, ShellInterface}; +use crate::shell_interface::{ScpParam, ServerCommand, ShellCommand}; use clap::{Parser, Subcommand, ValueEnum}; use lazy_regex::{lazy_regex, Lazy, Regex}; use server::{Server, ServerReference}; @@ -145,7 +145,7 @@ pub struct Application { impl Application where - E: Environment + ShellInterface, + E: Environment, { pub fn run(&mut self) -> Result<(), String> { let args = Args::try_parse_from(self.environment.args_os()).map_err(|e| e.to_string())?;