From be245adced9bd357c0b557af31273f3082c29703 Mon Sep 17 00:00:00 2001 From: Marat Radchenko Date: Sun, 14 Jun 2020 16:02:00 +0300 Subject: [PATCH] Switch to 2018 edition, upgrade deps --- Cargo.toml | 13 +++++-------- src/lib.rs | 38 +------------------------------------- 2 files changed, 6 insertions(+), 45 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a4f6634..09d616c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,29 +8,26 @@ readme = "README.md" keywords = ["vs2017", "detection", "query"] categories = ["development-tools::build-utils"] license = "Apache-2.0 OR MIT" +edition = "2018" [target.'cfg(target_os = "windows")'.dependencies.chrono] version = "0.4" features = ["serde"] [target.'cfg(target_os = "windows")'.dependencies.semver] -version = "0.9" +version = "0.10" features = ["serde"] [target.'cfg(target_os = "windows")'.dependencies.serde] version = "1" - -[target.'cfg(target_os = "windows")'.dependencies.serde_derive] -version = "1" +features = ["derive"] [target.'cfg(target_os = "windows")'.dependencies.serde_json] version = "1" [target.'cfg(target_os = "windows")'.dependencies.url] -version = "1" - -[target.'cfg(target_os = "windows")'.dependencies.url_serde] -version = "0.2" +version = "2" +features = ["serde"] [target.'cfg(target_os = "windows")'.dependencies.winapi] version = "0.3" diff --git a/src/lib.rs b/src/lib.rs index ee54b3e..2f30a60 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,36 +9,6 @@ //! Provides support for invoking and capturing the output of the vswhere utility. #![cfg(target_os = "windows")] -#![forbid(warnings)] -#![forbid(future_incompatible)] -#![deny(unused)] -#![forbid(box_pointers)] -#![forbid(missing_copy_implementations)] -#![forbid(missing_debug_implementations)] -#![forbid(missing_docs)] -#![forbid(trivial_casts)] -#![forbid(trivial_numeric_casts)] -#![forbid(unused_import_braces)] -#![deny(unused_qualifications)] -#![forbid(unused_results)] -#![forbid(variant_size_differences)] -#![cfg_attr(feature = "cargo-clippy", forbid(clippy))] -#![cfg_attr(feature = "cargo-clippy", deny(clippy_pedantic))] -#![cfg_attr(feature = "cargo-clippy", forbid(clippy_cargo))] -#![cfg_attr(feature = "cargo-clippy", forbid(clippy_complexity))] -#![cfg_attr(feature = "cargo-clippy", deny(clippy_correctness))] -#![cfg_attr(feature = "cargo-clippy", deny(clippy_perf))] -#![cfg_attr(feature = "cargo-clippy", forbid(clippy_style))] - -extern crate chrono; -extern crate semver; -extern crate serde; -#[macro_use] -extern crate serde_derive; -extern crate serde_json; -extern crate url; -extern crate url_serde; -extern crate winapi; use chrono::offset::Utc; use chrono::DateTime; @@ -78,7 +48,6 @@ pub struct Config { latest: bool, } -#[cfg_attr(feature = "cargo-clippy", allow(similar_names))] #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] /// Information about a Visual Studio installation. @@ -95,19 +64,15 @@ pub struct InstallInfo { description: String, channel_id: String, channel_path: PathBuf, - #[serde(with = "url_serde")] channel_uri: Url, engine_path: PathBuf, - #[serde(with = "url_serde")] release_notes: Url, - #[serde(with = "url_serde")] third_party_notices: Url, update_date: DateTime, catalog: InstallCatalog, properties: InstallProperties, } -#[cfg_attr(feature = "cargo-clippy", allow(similar_names))] #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] /// Catalog information for a Visual Studio installation. @@ -171,7 +136,6 @@ fn deserialize_uppercase_bool<'de, D: Deserializer<'de>>( deserializer.deserialize_str(UppercaseBoolVisitor) } -#[cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))] fn serialize_uppercase_bool( boolean: &bool, serializer: S, @@ -669,7 +633,7 @@ impl InstallProperties { #[cfg(test)] mod tests { - use {Config, FourPointVersion}; + use crate::{Config, FourPointVersion}; #[test] fn test_default() {