Skip to content

Commit ed5ec7f

Browse files
author
梶塚太智
committed
Update main.rs
1 parent b9dc5c2 commit ed5ec7f

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/main.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -529,18 +529,9 @@ impl Executor {
529529

530530
let text = self.pop_stack().get_string();
531531

532-
let value;
533-
match patern.captures(text.as_str()) {
534-
Some(i) => value = i,
535-
None => {
536-
self.stack.push(Type::List(vec![]));
537-
return;
538-
}
539-
}
540-
541532
let mut list: Vec<Type> = Vec::new();
542-
for i in 0..value.len() - 1 {
543-
list.push(Type::String(value.at(i).unwrap_or("").to_string()))
533+
for i in patern.captures_iter(text.as_str()) {
534+
list.push(Type::String(i[0].to_string()))
544535
}
545536
self.stack.push(Type::List(list));
546537
}

0 commit comments

Comments
 (0)