commit b34f91c933693b600c17c5d65a2d42d20721ba7e parent 1717a2492c188722f9a4e7d57be309a0c949290d Author: ~karx <karx@tilde.team> Date: Sun, 7 Feb 2021 17:30:10 +0000 Change separator to be a newline instead of space Diffstat:
M | src/main.rs | | | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main.rs b/src/main.rs @@ -16,9 +16,9 @@ impl Program { fn from_string(program: String) -> Program { let mut op_list: Vec<String> = Vec::new(); - for opcode in program.split(" ").collect::<Vec<&str>>() { - let mut new_op = opcode.to_owned(); - new_op = new_op.replace("\n", ""); + for opcode in program.split("\n").collect::<Vec<&str>>() { + let new_op = opcode.to_owned(); + // new_op = new_op.replace("\n", ""); if new_op.len() != 0 { op_list.push(new_op.to_owned());