diff --git a/src/plugin.rs b/src/plugin.rs index bbac5d6595..e96fc988f9 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -5,14 +5,6 @@ use std::io; pub trait Plugin { fn config(&mut self) -> Result; - #[allow(unused)] - fn is_valid(&self) -> bool { - true - } - - #[allow(unused)] - fn log_error(&mut self, message: &str) { } - #[allow(unused)] fn begin_filter(&mut self, call_info: CallInfo) -> Result, ShellError> { Ok(vec![]) diff --git a/src/plugins/str.rs b/src/plugins/str.rs index a929def8dd..8c1a68693a 100644 --- a/src/plugins/str.rs +++ b/src/plugins/str.rs @@ -21,6 +21,14 @@ impl Str { } } + fn is_valid(&self) -> bool { + (self.downcase && !self.upcase) || (!self.downcase && self.upcase) + } + + fn log_error(&mut self, message: &str) { + self.error = Some(message.to_string()); + } + fn to_downcase(&mut self) { self.downcase = true; @@ -107,14 +115,6 @@ impl Plugin for Str { }) } - fn is_valid(&self) -> bool { - (self.downcase && !self.upcase) || (!self.downcase && self.upcase) - } - - fn log_error(&mut self, message: &str) { - self.error = Some(message.to_string()); - } - fn begin_filter(&mut self, call_info: CallInfo) -> Result, ShellError> { if call_info.args.has("downcase") { self.to_downcase();