From 706172677867d4f31ab7394013335e865bd14866 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 14 Sep 2019 14:44:06 -0400 Subject: bump ynab_api --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- src/main.rs | 23 +++++++++++++++++------ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 33ed624..2ae7509 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1402,7 +1402,7 @@ dependencies = [ [[package]] name = "ynab-api" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "reqwest 0.9.20 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1417,7 +1417,7 @@ name = "ynab-export" version = "0.0.2" dependencies = [ "directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "ynab-api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ynab-api 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [metadata] @@ -1582,4 +1582,4 @@ dependencies = [ "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -"checksum ynab-api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "004581d786952ee09c3a4f1e2a2319eb51d992cb35bc3d4d068e9a46a224053b" +"checksum ynab-api 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2249731e972372209fd0d41e1db5da32312164d01e710159411138c753c2ba8" diff --git a/Cargo.toml b/Cargo.toml index 4b7fe01..e25e4b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,4 +9,4 @@ license = "MIT" [dependencies] directories = "2" -ynab-api = "1" +ynab-api = "2" diff --git a/src/main.rs b/src/main.rs index 965467a..5b8449e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -283,7 +283,10 @@ fn main() { .memo .unwrap_or_else(|| "\\N".to_string()) .as_ref(), - scheduled_transaction.flag_color.as_ref(), + scheduled_transaction + .flag_color + .unwrap_or_else(|| "\\N".to_string()) + .as_ref(), scheduled_transaction.account_id.as_ref(), scheduled_transaction .payee_id @@ -292,11 +295,16 @@ fn main() { // the split category doesn't appear to be in the categories // data, so we have to exclude it or else the NOT NULL // constraint will fail - if scheduled_transaction.category_id == SPLIT_CATEGORY_ID { - "\\N" + if scheduled_transaction.category_id + == Some(SPLIT_CATEGORY_ID.to_string()) + { + "\\N".to_string() } else { - scheduled_transaction.category_id.as_ref() - }, + scheduled_transaction + .category_id + .unwrap_or_else(|| "\\N".to_string()) + } + .as_ref(), scheduled_transaction .transfer_account_id .unwrap_or_else(|| "\\N".to_string()) @@ -330,7 +338,10 @@ fn main() { .payee_id .unwrap_or_else(|| "\\N".to_string()) .as_ref(), - scheduled_subtransaction.category_id.as_ref(), + scheduled_subtransaction + .category_id + .unwrap_or_else(|| "\\N".to_string()) + .as_ref(), scheduled_subtransaction .transfer_account_id .unwrap_or_else(|| "\\N".to_string()) -- cgit v1.2.3