Skip to content

Commit

Permalink
fix(cmn): get cmn compiling on nightly rust
Browse files Browse the repository at this point in the history
Closes Byron#131
  • Loading branch information
erickt committed Oct 18, 2015
1 parent 5612d00 commit 8179f3b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ name = "cmn"
path = "src/rust/lib.rs"

[dependencies]
clap = "*"
hyper = "*"
mime = "*"
rustc-serialize = "*"
yup-oauth2 = "*"
yup-oauth2 = { version = "*", features = ["nightly"], default-features = false }
serde = "*"
serde_json = "*"
serde_macros = "*"
strsim = "*"

[dev-dependencies]
yup-hyper-mock = "*"
6 changes: 3 additions & 3 deletions src/rust/cli/cmn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ impl TokenStorage for JsonTokenStorage {

fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result<Option<Token>, json::Error> {
match fs::File::open(&self.path(scope_hash)) {
Ok(mut f) => {
Ok(f) => {
match json::de::from_reader(f) {
Ok(token) => Ok(Some(token)),
Err(err) => Err(err),
Expand Down Expand Up @@ -578,7 +578,7 @@ impl fmt::Display for CLIError {
=> writeln!(f, "Failed to parse argument '{}' with value '{}' as {} with error: {}.",
arg_name, value, type_name, err_desc),
CLIError::UnknownParameter(ref param_name, ref possible_values) => {
let mut suffix =
let suffix =
match did_you_mean(param_name, &possible_values) {
Some(v) => format!(" Did you mean '{}' ?", v),
None => String::new(),
Expand Down Expand Up @@ -692,7 +692,7 @@ pub fn application_secret_from_directory(dir: &str,
}
return secret_io_error(err)
},
Ok(mut f) => {
Ok(f) => {
match json::de::from_reader::<_, ConsoleApplicationSecret>(f) {
Err(json::Error::IoError(err)) =>
return secret_io_error(err),
Expand Down
8 changes: 7 additions & 1 deletion src/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
#![allow(dead_code, deprecated, unused_features, unused_variables, unused_imports)]
//! library with code shared by all generated implementations
#![plugin(serde_macros)]

#[macro_use]
extern crate clap;

#[macro_use]
extern crate hyper;
extern crate mime;
extern crate rustc_serialize;
extern crate yup_oauth2 as oauth2;
extern crate serde;
extern crate serde_json;
extern crate strsim;

// just pull it in the check if it compiles
mod api;
Expand Down Expand Up @@ -194,4 +200,4 @@ mod test_cli {
assert_eq!(c.num_fields(), 3);
assert_eq!(c.to_string(), "one.beer.one");
}
}
}

0 comments on commit 8179f3b

Please sign in to comment.