From 0c000337d24e38c131ad8aa4733da47184edc7ee Mon Sep 17 00:00:00 2001 From: Erin Date: Sun, 1 Aug 2021 18:28:59 +0200 Subject: [PATCH] fmt --- src/repl.rs | 2 +- src/variables.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/repl.rs b/src/repl.rs index af084b54..fdebf5d8 100644 --- a/src/repl.rs +++ b/src/repl.rs @@ -20,7 +20,7 @@ pub fn repl(ast_print: bool) { println!("bye"); break; } - + let mut parser = Parser::new(line); let value = parser.init().and_then(|ast| { if ast_print { diff --git a/src/variables.rs b/src/variables.rs index 499c6343..962f4b68 100644 --- a/src/variables.rs +++ b/src/variables.rs @@ -137,9 +137,9 @@ impl Value { Rc::new(RefCell::new(match self { Value::Nul => Value::Nul, Value::Str(s) => Value::Int(s.as_bytes()[index.to_i32() as usize] as i32), - Value::Int(i) => Value::Int( - (format!("{}", i).as_bytes()[index.to_i32() as usize] - b'0') as i32, - ), + Value::Int(i) => { + Value::Int((format!("{}", i).as_bytes()[index.to_i32() as usize] - b'0') as i32) + } Value::Bool(b) => Value::Int( format!("{}", b) .chars()