Make rust and clippy happy
@@ -4,9 +4,9 @@ use curl::http::handle::{Method, Request};
use regex::Regex;
use rustc_serialize::json;
use rustc_serialize::json::{BuilderError, Json, Object};
+use semver::Version;
use std::env;
use std::path::Path;
-use semver::Version;
const REGISTRY_HOST: &'static str = "https://crates.io";
@@ -39,8 +39,11 @@ pub fn get_latest_dependency(crate_name: &str, flag_fetch_prereleases: bool) ->
// Checks whether a version object is a stable release
fn version_is_stable(version: &Object) -> bool {
- version.get("num").and_then(Json::as_string).and_then(|s| Version::parse(s).ok())
- .map(|s| !s.is_prerelease()).unwrap_or(false)
+ version.get("num")
+ .and_then(Json::as_string)
+ .and_then(|s| Version::parse(s).ok())
+ .map(|s| !s.is_prerelease())
+ .unwrap_or(false)
}
/// Read latest version from JSON structure
