summaryrefslogtreecommitdiffstats
path: root/src/parse.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-01-03 06:44:23 -0500
committerJesse Luehrs <doy@tozt.net>2022-01-03 07:05:53 -0500
commit6c79e520f02e7d05f389db5856fda250437a563f (patch)
treeb0357b5ca41439e7a2ff59602febc4dbf2d0ca35 /src/parse.rs
parentae132f478c6cfc6ffb062fecd7efb42ac4e5d804 (diff)
downloadnbsh-6c79e520f02e7d05f389db5856fda250437a563f.tar.gz
nbsh-6c79e520f02e7d05f389db5856fda250437a563f.zip
more clone cleanups
Diffstat (limited to 'src/parse.rs')
-rw-r--r--src/parse.rs16
1 files changed, 6 insertions, 10 deletions
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<Word>,
@@ -56,7 +56,7 @@ impl Exe {
}
}
-#[derive(Debug, Clone)]
+#[derive(Debug)]
pub struct Pipeline {
exes: Vec<Exe>,
input_string: String,
@@ -90,7 +90,7 @@ impl Pipeline {
}
}
-#[derive(Debug, Clone)]
+#[derive(Debug)]
pub struct Commands {
pipelines: Vec<Pipeline>,
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
}
}