diff options
author | Vincent Ambo <mail@tazj.in> | 2021-02-27T09·27+0200 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2021-02-27T13·05+0000 |
commit | 75750ba6835ae8ac3a97c24ca7ff5ebc1500f36d (patch) | |
tree | 35138b7ae42bcb6668b982224f6d5f3febbeafa6 /users/tazjin/rlox/src/main.rs | |
parent | ebc987f4aaf653c227d21bec5998c62e87da7f7b (diff) |
style(tazjin/rlox): Set max_width=80 r/2235
Change-Id: Ib64831c0b97c94fdfbdbae64f4dfccc86879ef73 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2554 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
Diffstat (limited to 'users/tazjin/rlox/src/main.rs')
-rw-r--r-- | users/tazjin/rlox/src/main.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/users/tazjin/rlox/src/main.rs b/users/tazjin/rlox/src/main.rs index 3a956833c15d..2b4e365d4125 100644 --- a/users/tazjin/rlox/src/main.rs +++ b/users/tazjin/rlox/src/main.rs @@ -15,7 +15,10 @@ pub trait Lox { type Error: std::fmt::Display; fn create() -> Self; - fn interpret(&mut self, source: String) -> Result<Self::Value, Vec<Self::Error>>; + fn interpret( + &mut self, + source: String, + ) -> Result<Self::Value, Vec<Self::Error>>; } fn main() { @@ -26,7 +29,9 @@ fn main() { } match env::var("LOX_INTERPRETER").as_ref().map(String::as_str) { - Ok("treewalk") => pick::<treewalk::interpreter::Interpreter>(args.nth(1)), + Ok("treewalk") => { + pick::<treewalk::interpreter::Interpreter>(args.nth(1)) + } _ => pick::<bytecode::Interpreter>(args.nth(1)), } } @@ -41,7 +46,8 @@ fn pick<I: Lox>(file_arg: Option<String>) { // Run Lox code from a file and print results to stdout fn run_file<I: Lox>(file: &str) { - let contents = fs::read_to_string(file).expect("failed to read the input file"); + let contents = + fs::read_to_string(file).expect("failed to read the input file"); let mut lox = I::create(); run(&mut lox, contents); } |