From 6c79e520f02e7d05f389db5856fda250437a563f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 3 Jan 2022 06:44:23 -0500 Subject: more clone cleanups --- src/parse.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/parse.rs') diff --git a/src/parse.rs b/src/parse.rs index 4bdbce2..45c83c5 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -4,7 +4,7 @@ use pest::Parser as _; #[grammar = "shell.pest"] struct Shell; -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct Word { word: String, interpolate: bool, @@ -28,7 +28,7 @@ impl Word { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct Exe { exe: Word, args: Vec, @@ -56,7 +56,7 @@ impl Exe { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct Pipeline { exes: Vec, input_string: String, @@ -90,7 +90,7 @@ impl Pipeline { } } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct Commands { pipelines: Vec, input_string: String, @@ -144,12 +144,8 @@ impl Error { } } - pub fn input(&self) -> &str { - &self.input - } - - pub fn error(&self) -> &anyhow::Error { - &self.e + pub fn into_input(self) -> String { + self.input } } -- cgit v1.2.3-54-g00ecf