From ff9cd851efb453ffa85e150a3dbf634dafd88c01 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 14 Aug 2020 01:06:34 +0100 Subject: [PATCH] repro syn span thing before update --- src/bin/otter.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/bin/otter.rs b/src/bin/otter.rs index 91adcc10..6bb42731 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -194,10 +194,8 @@ inventory::submit!{Subcommand( do_create_table, )} -//#[throws(E)] -fn do_create_table(_sc: &Subcommand, ma: MainOpts, args: Vec) - -> Result<(),E> -{ +#[throws(E)] +fn do_create_table(_sc: &Subcommand, ma: MainOpts, args: Vec) { #[derive(Default,Debug)] struct Args { name: String, @@ -216,16 +214,13 @@ fn do_create_table(_sc: &Subcommand, ma: MainOpts, args: Vec) Ok(()) }, None); -let specf = &args.file; - let spec = {//(|f|{ - - let mut f = File::open(specf).context("open")?; + let spec = (||{ + let mut f = File::open(&args.file).context("open")?; let mut buf = String::new(); f.read_to_string(&mut buf).context("read")?; let spec : TableSpec = toml::de::from_str(&buf).context("parse")?; >::Ok(spec) -// })(&args.file).context("game spec toml").context(&args.file)?; - }; + })().context("game spec toml").context(&args.file)?; let chan = connect(&ma)?; -- 2.30.2