diff --git a/Cargo.lock b/Cargo.lock index 34928d2..8050792 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1473,12 +1473,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "protobuf" version = "3.0.0-pre" -source = "git+https://github.com/stepancheg/rust-protobuf#4c97ba2a1624626d2ac8472ec9139613744f1de9" +source = "git+https://github.com/stepancheg/rust-protobuf#c28865f0ada87733b80806eecbdcbd4906d13ee3" [[package]] name = "protobuf-codegen" version = "3.0.0-pre" -source = "git+https://github.com/stepancheg/rust-protobuf#4c97ba2a1624626d2ac8472ec9139613744f1de9" +source = "git+https://github.com/stepancheg/rust-protobuf#c28865f0ada87733b80806eecbdcbd4906d13ee3" dependencies = [ "protobuf 3.0.0-pre (git+https://github.com/stepancheg/rust-protobuf)", ] @@ -1486,7 +1486,7 @@ dependencies = [ [[package]] name = "protobuf-codegen-pure" version = "3.0.0-pre" -source = "git+https://github.com/stepancheg/rust-protobuf#4c97ba2a1624626d2ac8472ec9139613744f1de9" +source = "git+https://github.com/stepancheg/rust-protobuf#c28865f0ada87733b80806eecbdcbd4906d13ee3" dependencies = [ "protobuf 3.0.0-pre (git+https://github.com/stepancheg/rust-protobuf)", "protobuf-codegen 3.0.0-pre (git+https://github.com/stepancheg/rust-protobuf)", diff --git a/src/cmds/login.rs b/src/cmds/login.rs index 8a451e6..331b4ea 100644 --- a/src/cmds/login.rs +++ b/src/cmds/login.rs @@ -32,7 +32,7 @@ use base::clock::{self, Clocks}; use db::auth::SessionFlags; -use failure::{Error, bail, format_err}; +use failure::{Error, ResultExt, bail, format_err}; use serde::Deserialize; use std::os::unix::fs::OpenOptionsExt as _; use std::io::Write as _; @@ -89,7 +89,7 @@ pub fn run() -> Result<(), Error> { let permissions = match args.flag_permissions { None => u.permissions.clone(), Some(s) => protobuf::text_format::parse_from_str(&s) - .map_err(|_| format_err!("unable to parse --permissions"))? + .context("unable to parse --permissions")? }; let creation = db::auth::Request { when_sec: Some(db.clocks().realtime().sec), diff --git a/src/cmds/run.rs b/src/cmds/run.rs index ab4239d..d41b82b 100644 --- a/src/cmds/run.rs +++ b/src/cmds/run.rs @@ -33,7 +33,7 @@ use crate::stream; use crate::streamer; use crate::web; use db::{dir, writer}; -use failure::{Error, bail, format_err}; +use failure::{Error, ResultExt, bail}; use fnv::FnvHashMap; use futures::{Future, Stream}; use log::{error, info, warn}; @@ -195,7 +195,7 @@ pub fn run() -> Result<(), Error> { let allow_unauthenticated_permissions = args.flag_allow_unauthenticated_permissions .map(|s| protobuf::text_format::parse_from_str(&s)) .transpose() - .map_err(|_| format_err!("Unable to parse --allow-unauthenticated-permissions"))?; + .context("Unable to parse --allow-unauthenticated-permissions")?; let s = web::Service::new(web::Config { db: db.clone(), ui_dir: Some(&args.flag_ui_dir),