Преглед изворни кода

Replace deprecated function for Send v2

timvisee пре 6 година
родитељ
комит
dd8a7fe645
5 измењених фајлова са 9 додато и 7 уклоњено
  1. 3 3
      Cargo.lock
  2. 3 1
      Cargo.toml
  3. 1 1
      src/action/download.rs
  4. 1 1
      src/action/exists.rs
  5. 1 1
      src/action/info.rs

+ 3 - 3
Cargo.lock

@@ -486,7 +486,7 @@ dependencies = [
  "derive_builder 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "directories 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "ffsend-api 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "ffsend-api 0.1.1 (git+https://gitlab.com/timvisee/ffsend-api.git?rev=send2)",
  "fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "open 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -505,7 +505,7 @@ dependencies = [
 [[package]]
 name = "ffsend-api"
 version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+source = "git+https://gitlab.com/timvisee/ffsend-api.git?rev=send2#cb48d0598993177227cba2333bd964235afbcceb"
 dependencies = [
  "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1895,7 +1895,7 @@ dependencies = [
 "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2"
 "checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1"
 "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
-"checksum ffsend-api 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796506969efa8e97ca09320d9e6933ac1b40ee98276db29d29a9a638174e701a"
+"checksum ffsend-api 0.1.1 (git+https://gitlab.com/timvisee/ffsend-api.git?rev=send2)" = "<none>"
 "checksum filetime 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a2df5c1a8c4be27e7707789dc42ae65976e60b394afd293d1419ab915833e646"
 "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
 "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"

+ 3 - 1
Cargo.toml

@@ -69,7 +69,9 @@ colored = "1.7"
 derive_builder = "0.7"
 directories = "1.0"
 failure = "0.1"
-ffsend-api = "0.1.1"
+# TODO: revert to crates.io package when merged to master
+# ffsend-api = "0.1.1"
+ffsend-api = { git = "https://gitlab.com/timvisee/ffsend-api.git", rev = "send2" }
 fs2 = "0.4"
 lazy_static = "1.0"
 open = "1"

+ 1 - 1
src/action/download.rs

@@ -68,7 +68,7 @@ impl<'a> Download<'a> {
         }
 
         // Ensure a password is set when required
-        ensure_password(&mut password, exists.has_password(), &matcher_main);
+        ensure_password(&mut password, exists.requires_password(), &matcher_main);
 
         // Fetch the file metadata
         let metadata = ApiMetadata::new(&file, password.clone(), false).invoke(&client)?;

+ 1 - 1
src/action/exists.rs

@@ -43,7 +43,7 @@ impl<'a> Exists<'a> {
         // Print the results
         println!("Exists: {:?}", exists);
         if exists {
-            println!("Password: {:?}", exists_response.has_password());
+            println!("Password: {:?}", exists_response.requires_password());
         }
 
         // Add or remove the file from the history

+ 1 - 1
src/action/info.rs

@@ -61,7 +61,7 @@ impl<'a> Info<'a> {
         let mut password = matcher_info.password();
 
         // Ensure a password is set when required
-        ensure_password(&mut password, exists.has_password(), &matcher_main);
+        ensure_password(&mut password, exists.requires_password(), &matcher_main);
 
         // Fetch both file info and metadata
         let info = ApiInfo::new(&file, None).invoke(&client)?;