From 5a83609b739f37921a9d233769b7264ecb136f32 Mon Sep 17 00:00:00 2001 From: Zachary Bush Date: Mon, 7 Oct 2019 18:29:01 -0700 Subject: [PATCH] Stop manually importing serde_derive (#118) --- Cargo.lock | 5 +++-- Cargo.toml | 3 +-- budgetronlib/Cargo.toml | 3 +-- budgetronlib/src/config.rs | 2 +- budgetronlib/src/fintime.rs | 1 - src/loading/alliant.rs | 2 +- src/loading/generic.rs | 2 +- src/loading/logix.rs | 2 +- src/loading/mint.rs | 2 +- src/processing/config.rs | 2 +- src/reporting/by_account.rs | 2 +- src/reporting/by_timeframe.rs | 2 +- src/reporting/cashflow.rs | 2 +- src/reporting/categories.rs | 2 +- src/reporting/config.rs | 2 +- src/reporting/income_expense_ratio.rs | 2 +- src/reporting/rolling_budget.rs | 2 +- src/reporting/timeseries.rs | 2 +- 18 files changed, 19 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 24353f3..12ea4eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -118,7 +118,6 @@ dependencies = [ "mount 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", "staticfile 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -133,7 +132,6 @@ dependencies = [ "csv 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -725,6 +723,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "serde" version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde_derive 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "serde_derive" diff --git a/Cargo.toml b/Cargo.toml index 6b710aa..c6ce885 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ doc = false [dependencies] # Both budgetronlib = { path = "budgetronlib" } -serde = "1.0.101" +serde = { version = "1.0.101", features = ["derive"] } serde_json = "1.0.40" # Library @@ -19,7 +19,6 @@ csv = "1.1.1" #data_store = { path = "data_store", optional = true } log = "0.4.8" regex = "1.3.1" -serde_derive = "1.0.101" # Binary structopt = "0.3.2" diff --git a/budgetronlib/Cargo.toml b/budgetronlib/Cargo.toml index 2a053a8..631bece 100644 --- a/budgetronlib/Cargo.toml +++ b/budgetronlib/Cargo.toml @@ -6,8 +6,7 @@ edition = "2018" [dependencies] chrono = "0.4.9" -serde = "1.0.101" -serde_derive = "1.0.101" +serde = { version = "1.0.101", features = ["derive"] } toml = "0.5.3" csv = "1.1.1" dirs = "2.0.2" diff --git a/budgetronlib/src/config.rs b/budgetronlib/src/config.rs index 66321f8..62f59d5 100644 --- a/budgetronlib/src/config.rs +++ b/budgetronlib/src/config.rs @@ -9,7 +9,7 @@ use { crate::error::{BResult, BudgetError}, serde::de::DeserializeOwned, - serde_derive::Deserialize, + serde::Deserialize, std::{collections::HashMap, env, fs::File, io::Read, path::PathBuf}, toml, }; diff --git a/budgetronlib/src/fintime.rs b/budgetronlib/src/fintime.rs index 2138cef..d798e61 100644 --- a/budgetronlib/src/fintime.rs +++ b/budgetronlib/src/fintime.rs @@ -10,7 +10,6 @@ use { self::Timeframe::*, chrono::{self, offset::TimeZone, Datelike}, serde::{de, Deserialize, Deserializer, Serialize, Serializer}, - serde_derive::Serialize, std::{fmt, ops}, }; diff --git a/src/loading/alliant.rs b/src/loading/alliant.rs index 7e76ab4..2dca1ca 100644 --- a/src/loading/alliant.rs +++ b/src/loading/alliant.rs @@ -12,7 +12,7 @@ use { money::Money, }, budgetronlib::{error::BResult, fintime::Date}, - serde_derive::Deserialize, + serde::Deserialize, }; // "id","account_id","reference_id","transaction_type","amount","posted_at", diff --git a/src/loading/generic.rs b/src/loading/generic.rs index a547c7b..6da093e 100644 --- a/src/loading/generic.rs +++ b/src/loading/generic.rs @@ -9,7 +9,7 @@ use { crate::loading::money::Money, budgetronlib::{error::BResult, fintime::Date}, - serde_derive::{Deserialize, Serialize}, + serde::{Deserialize, Serialize}, }; #[derive(Debug, Serialize, Copy, Deserialize, PartialEq, Clone, Eq, PartialOrd, Ord)] diff --git a/src/loading/logix.rs b/src/loading/logix.rs index 47f5586..4923cef 100644 --- a/src/loading/logix.rs +++ b/src/loading/logix.rs @@ -12,7 +12,7 @@ use { money::Money, }, budgetronlib::{error::BResult, fintime::Date}, - serde_derive::Deserialize, + serde::Deserialize, }; #[derive(Debug, Deserialize)] diff --git a/src/loading/mint.rs b/src/loading/mint.rs index 95f8b25..89c96b6 100644 --- a/src/loading/mint.rs +++ b/src/loading/mint.rs @@ -12,7 +12,7 @@ use { money::Money, }, budgetronlib::{error::BResult, fintime::Date}, - serde_derive::Deserialize, + serde::Deserialize, }; #[derive(Debug, Deserialize)] diff --git a/src/processing/config.rs b/src/processing/config.rs index 99dc745..e82f7e0 100644 --- a/src/processing/config.rs +++ b/src/processing/config.rs @@ -12,7 +12,7 @@ use { processing::{regex::Regex, Collate, RefundCollator, TransferCollator}, }, budgetronlib::error::BResult, - serde_derive::Deserialize, + serde::Deserialize, std::collections::HashMap, }; diff --git a/src/reporting/by_account.rs b/src/reporting/by_account.rs index ff62fd9..b7a09f0 100644 --- a/src/reporting/by_account.rs +++ b/src/reporting/by_account.rs @@ -11,7 +11,7 @@ use { loading::{Transaction, TransactionType}, reporting::Reporter, }, - serde_derive::Serialize, + serde::Serialize, serde_json::{self, Value}, std::{borrow::Cow, fmt}, }; diff --git a/src/reporting/by_timeframe.rs b/src/reporting/by_timeframe.rs index d276f5d..36b9ab0 100644 --- a/src/reporting/by_timeframe.rs +++ b/src/reporting/by_timeframe.rs @@ -9,7 +9,7 @@ use { crate::{loading::Transaction, reporting::Reporter}, budgetronlib::fintime::{Date, Timeframe}, - serde_derive::Serialize, + serde::Serialize, serde_json::{self, Value}, std::{borrow::Cow, collections::BTreeMap, fmt}, }; diff --git a/src/reporting/cashflow.rs b/src/reporting/cashflow.rs index b03355a..bb31dd6 100644 --- a/src/reporting/cashflow.rs +++ b/src/reporting/cashflow.rs @@ -11,7 +11,7 @@ use { loading::{Money, Transaction, TransactionType}, reporting::{config::ReportOptions, timeseries::Timeseries, Reporter}, }, - serde_derive::Serialize, + serde::Serialize, serde_json::{self, Value}, std::{borrow::Cow, fmt}, }; diff --git a/src/reporting/categories.rs b/src/reporting/categories.rs index febf6ab..7b2165d 100644 --- a/src/reporting/categories.rs +++ b/src/reporting/categories.rs @@ -11,7 +11,7 @@ use { loading::{Money, Transaction, TransactionType}, reporting::{config::ReportOptions, timeseries::Timeseries, Reporter}, }, - serde_derive::Serialize, + serde::Serialize, serde_json::{self, Value}, std::{borrow::Cow, collections::HashMap}, }; diff --git a/src/reporting/config.rs b/src/reporting/config.rs index d34f482..7cea49d 100644 --- a/src/reporting/config.rs +++ b/src/reporting/config.rs @@ -12,7 +12,7 @@ use { reporting::{Cashflow, Categories, IncomeExpenseRatio, Reporter, RollingBudget}, }, budgetronlib::fintime::Date, - serde_derive::{Deserialize, Serialize}, + serde::{Deserialize, Serialize}, serde_json::{self, Value}, std::{borrow::Cow, collections::HashMap}, }; diff --git a/src/reporting/income_expense_ratio.rs b/src/reporting/income_expense_ratio.rs index c68ec1c..94a75dd 100644 --- a/src/reporting/income_expense_ratio.rs +++ b/src/reporting/income_expense_ratio.rs @@ -11,7 +11,7 @@ use { loading::{Money, Transaction, TransactionType}, reporting::Reporter, }, - serde_derive::Serialize, + serde::Serialize, serde_json::{self, Value}, std::{borrow::Cow, collections::HashMap}, }; diff --git a/src/reporting/rolling_budget.rs b/src/reporting/rolling_budget.rs index 9ce172b..824a624 100644 --- a/src/reporting/rolling_budget.rs +++ b/src/reporting/rolling_budget.rs @@ -12,7 +12,7 @@ use { reporting::{config::ReportOptions, timeseries::Timeseries, Reporter}, }, budgetronlib::fintime::Date, - serde_derive::{Deserialize, Serialize}, + serde::{Deserialize, Serialize}, serde_json::{self, Value}, std::{borrow::Cow, collections::HashMap}, }; diff --git a/src/reporting/timeseries.rs b/src/reporting/timeseries.rs index a9e9e7e..21f94be 100644 --- a/src/reporting/timeseries.rs +++ b/src/reporting/timeseries.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use {budgetronlib::fintime::Date, serde_derive::Serialize}; +use {budgetronlib::fintime::Date, serde::Serialize}; #[derive(Debug, Serialize)] pub struct Timeseries(Vec>);