Skip to content

Commit 1af3757

Browse files
committed
remove unneeded chars
1 parent 182543f commit 1af3757

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

source/code2text/src/main.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,21 @@ fn parse_args() -> Arguments {
119119
}
120120
}
121121

122+
fn remove_chars(input: String) -> String {
123+
let mut new_value = String::new();
124+
for i in input.chars() {
125+
match i {
126+
'\'' | '\"' | '.' => {
127+
continue;
128+
}
129+
_=> {
130+
new_value.push(i);
131+
}
132+
}
133+
}
134+
new_value
135+
}
136+
122137
fn gen_words(
123138
input: &str,
124139
num: usize,
@@ -134,7 +149,7 @@ fn gen_words(
134149
for line in r.lines() {
135150
match line {
136151
Ok(l) => {
137-
lines.push(l);
152+
lines.push(remove_chars(l));
138153
}
139154
Err(e) => {
140155
eprintln!("Error: {}", e);

0 commit comments

Comments
 (0)