aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs40
1 files changed, 19 insertions, 21 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 0bd097d..bb60fca 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -238,30 +238,28 @@ impl S3G {
"" => String::from(""),
n => {
let mut string = String::new();
- for x in n.split_ascii_whitespace() {
- // Commands
- for c in &self.config.commands {
- let delim = String::new() + &self.config.command_delim.get(1..2).unwrap() + &c.0;
- if x.contains(&delim) {
- let x = x.replace(&delim, &c.1);
- string.push_str(&x);
- }
+ // Commands
+ for c in &self.config.commands {
+ let delim = String::new() + &self.config.command_delim.get(1..2).unwrap() + &c.0;
+ if n.contains(&delim) {
+ let n = n.replace(&delim, &c.1);
+ string.push_str(&n);
}
+ }
- // Files
- if x.contains(&self.config.file_delim.get(1..2).unwrap()) {
- let x: Vec<&str> = x.split(&self.config.file_delim.get(1..2).unwrap()).collect();
- for s in x {
- let s = match s {
- "" => String::from(""),
- // Scan the file from the path
- n => self.file_scan(&path::PathBuf::from(n)).unwrap_or(String::from("")),
- };
+ // Files
+ if n.contains(&self.config.file_delim.get(1..2).unwrap()) {
+ let n: Vec<&str> = n.split(&self.config.file_delim.get(1..2).unwrap()).collect();
+ for s in n {
+ let s = match s {
+ "" => String::from(""),
+ // Scan the file from the path
+ n => self.file_scan(&path::PathBuf::from(n)).unwrap_or(String::from("")),
+ };
- string.push_str(&s);
- }
-
+ string.push_str(&s);
}
+
}
string
},
@@ -301,4 +299,4 @@ impl S3G {
Err(_) => Err(()),
}
}
-} \ No newline at end of file
+}