From e2c7841f4a2cb3c070d4f33b5b82047238ef152f Mon Sep 17 00:00:00 2001 From: rzmk <30333942+rzmk@users.noreply.github.com> Date: Fri, 2 May 2025 17:10:38 -0400 Subject: [PATCH 01/29] docs: add home description for library docs --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 9ccc15d..4ef57c0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,9 @@ +//! # ckanaction +//! +//! Rust library crate to access [CKAN](https://ckan.org) Action API endpoints through Rust builders. Based on the CKAN Action API v3. Endpoints are expected to return with an output of type `serde_json::Value`. +//! +//! Learn more at [github.com/dathere/ckanaction](https://github.com/dathere/ckanaction). + use bon::bon; use serde_json::json; use std::{collections::HashMap, path::PathBuf}; From a7fa0ac862a7402541b1c9c36f2e2ea51ba986c4 Mon Sep 17 00:00:00 2001 From: rzmk <30333942+rzmk@users.noreply.github.com> Date: Fri, 2 May 2025 17:17:57 -0400 Subject: [PATCH 02/29] build: remove tokio and bin --- Cargo.lock | 72 ----------------------------------------------------- Cargo.toml | 1 - src/main.rs | 14 ----------- 3 files changed, 87 deletions(-) delete mode 100644 src/main.rs diff --git a/Cargo.lock b/Cargo.lock index 1288f78..9a6ee56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,7 +116,6 @@ dependencies = [ "reqwest", "serde", "serde_json", - "tokio", ] [[package]] @@ -665,16 +664,6 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - [[package]] name = "log" version = "0.4.27" @@ -799,29 +788,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - [[package]] name = "percent-encoding" version = "2.3.1" @@ -880,15 +846,6 @@ version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" -[[package]] -name = "redox_syscall" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" -dependencies = [ - "bitflags", -] - [[package]] name = "reqwest" version = "0.12.15" @@ -1029,12 +986,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - [[package]] name = "security-framework" version = "2.11.1" @@ -1108,15 +1059,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "signal-hook-registry" -version = "1.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" -dependencies = [ - "libc", -] - [[package]] name = "slab" version = "0.4.9" @@ -1245,25 +1187,11 @@ dependencies = [ "bytes", "libc", "mio", - "parking_lot", "pin-project-lite", - "signal-hook-registry", "socket2", - "tokio-macros", "windows-sys 0.52.0", ] -[[package]] -name = "tokio-macros" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tokio-native-tls" version = "0.3.1" diff --git a/Cargo.toml b/Cargo.toml index 46922e7..b249681 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,4 +13,3 @@ bon = "3.6.3" reqwest = { version = "0.12.15", features = ["json", "multipart", "stream"] } serde = "1.0.219" serde_json = "1.0.140" -tokio = { version = "1.44.2", features = ["full"] } diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index a345eb4..0000000 --- a/src/main.rs +++ /dev/null @@ -1,14 +0,0 @@ -#[tokio::main] -async fn main() -> Result<(), Box> { - // Initialize and build CKAN struct - let ckan = ckanaction::CKAN::builder() - .url("http://localhost:5000") - .token("CKAN_API_TOKEN".to_string()) - .build(); - - // Send request to /status_show and print output - let status_show = ckan.status_show().await?; - println!("{status_show:#?}"); - - Ok(()) -} From b1d8d957f96bbf92f4abca3682dffc2367c5d449 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Tue, 27 May 2025 10:46:11 -0400 Subject: [PATCH 03/29] chore: make clippy happy warning: this `else` branch is empty --> src/lib.rs:24:7 | 24 | } else { | _______^ 25 | | }; | |_____^ help: you can remove it | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_else = note: `#[warn(clippy::needless_else)]` on by default warning: unneeded unit expression --> src/lib.rs:23:9 | 23 | () | ^^ help: remove the final `()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit = note: `#[warn(clippy::unused_unit)]` on by default warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:822:9 | 822 | Ok(Self::get(&self, endpoint).await?) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark = note: `#[warn(clippy::needless_question_mark)]` on by default help: remove the enclosing `Ok` and `?` operator | 822 - Ok(Self::get(&self, endpoint).await?) 822 + Self::get(&self, endpoint).await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:822:22 | 822 | Ok(Self::get(&self, endpoint).await?) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow = note: `#[warn(clippy::needless_borrow)]` on by default warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:828:9 | 828 | Ok(Self::get(&self, endpoint).await?) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 828 - Ok(Self::get(&self, endpoint).await?) 828 + Self::get(&self, endpoint).await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:828:22 | 828 | Ok(Self::get(&self, endpoint).await?) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1246:9 | 1246 | Ok(Self::get(&self, endpoint).await?) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1246 - Ok(Self::get(&self, endpoint).await?) 1246 + Self::get(&self, endpoint).await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1246:22 | 1246 | Ok(Self::get(&self, endpoint).await?) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:98:9 | 98 | / Ok(Self::post(&self) 99 | | .endpoint(endpoint) 100 | | .body(body) 101 | | .call() 102 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 98 ~ Self::post(&self) 99 | .endpoint(endpoint) 100 | .body(body) 101 | .call() 102 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:98:23 | 98 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:119:9 | 119 | / Ok(Self::post(&self) 120 | | .endpoint(endpoint) 121 | | .body(body) 122 | | .call() 123 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 119 ~ Self::post(&self) 120 | .endpoint(endpoint) 121 | .body(body) 122 | .call() 123 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:119:23 | 119 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:140:9 | 140 | / Ok(Self::post(&self) 141 | | .endpoint(endpoint) 142 | | .body(body) 143 | | .call() 144 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 140 ~ Self::post(&self) 141 | .endpoint(endpoint) 142 | .body(body) 143 | .call() 144 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:140:23 | 140 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:159:9 | 159 | / Ok(Self::post(&self) 160 | | .endpoint(endpoint) 161 | | .body(body) 162 | | .call() 163 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 159 ~ Self::post(&self) 160 | .endpoint(endpoint) 161 | .body(body) 162 | .call() 163 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:159:23 | 159 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:178:9 | 178 | / Ok(Self::post(&self) 179 | | .endpoint(endpoint) 180 | | .body(body) 181 | | .call() 182 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 178 ~ Self::post(&self) 179 | .endpoint(endpoint) 180 | .body(body) 181 | .call() 182 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:178:23 | 178 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:217:9 | 217 | / Ok(Self::post(&self) 218 | | .endpoint(endpoint) 219 | | .body(body) 220 | | .call() 221 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 217 ~ Self::post(&self) 218 | .endpoint(endpoint) 219 | .body(body) 220 | .call() 221 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:217:23 | 217 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:256:9 | 256 | / Ok(Self::post(&self) 257 | | .endpoint(endpoint) 258 | | .body(body) 259 | | .call() 260 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 256 ~ Self::post(&self) 257 | .endpoint(endpoint) 258 | .body(body) 259 | .call() 260 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:256:23 | 256 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:275:9 | 275 | / Ok(Self::post(&self) 276 | | .endpoint(endpoint) 277 | | .body(body) 278 | | .call() 279 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 275 ~ Self::post(&self) 276 | .endpoint(endpoint) 277 | .body(body) 278 | .call() 279 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:275:23 | 275 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:296:9 | 296 | / Ok(Self::post(&self) 297 | | .endpoint(endpoint) 298 | | .body(body) 299 | | .call() 300 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 296 ~ Self::post(&self) 297 | .endpoint(endpoint) 298 | .body(body) 299 | .call() 300 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:296:23 | 296 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:307:9 | 307 | Ok(Self::post(&self).endpoint(endpoint).call().await?) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 307 - Ok(Self::post(&self).endpoint(endpoint).call().await?) 307 + Self::post(&self).endpoint(endpoint).call().await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:307:23 | 307 | Ok(Self::post(&self).endpoint(endpoint).call().await?) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:324:9 | 324 | / Ok(Self::post(&self) 325 | | .endpoint(endpoint) 326 | | .body(body) 327 | | .call() 328 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 324 ~ Self::post(&self) 325 | .endpoint(endpoint) 326 | .body(body) 327 | .call() 328 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:324:23 | 324 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:349:9 | 349 | / Ok(Self::post(&self) 350 | | .endpoint(endpoint) 351 | | .body(body) 352 | | .call() 353 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 349 ~ Self::post(&self) 350 | .endpoint(endpoint) 351 | .body(body) 352 | .call() 353 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:349:23 | 349 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:370:9 | 370 | / Ok(Self::post(&self) 371 | | .endpoint(endpoint) 372 | | .body(body) 373 | | .call() 374 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 370 ~ Self::post(&self) 371 | .endpoint(endpoint) 372 | .body(body) 373 | .call() 374 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:370:23 | 370 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:387:9 | 387 | / Ok(Self::post(&self) 388 | | .endpoint(endpoint) 389 | | .body(body) 390 | | .call() 391 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 387 ~ Self::post(&self) 388 | .endpoint(endpoint) 389 | .body(body) 390 | .call() 391 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:387:23 | 387 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:404:9 | 404 | / Ok(Self::post(&self) 405 | | .endpoint(endpoint) 406 | | .body(body) 407 | | .call() 408 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 404 ~ Self::post(&self) 405 | .endpoint(endpoint) 406 | .body(body) 407 | .call() 408 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:404:23 | 404 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:421:9 | 421 | / Ok(Self::post(&self) 422 | | .endpoint(endpoint) 423 | | .body(body) 424 | | .call() 425 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 421 ~ Self::post(&self) 422 | .endpoint(endpoint) 423 | .body(body) 424 | .call() 425 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:421:23 | 421 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:452:9 | 452 | / Ok(Self::post(&self) 453 | | .endpoint(endpoint) 454 | | .body(body) 455 | | .call() 456 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 452 ~ Self::post(&self) 453 | .endpoint(endpoint) 454 | .body(body) 455 | .call() 456 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:452:23 | 452 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:483:9 | 483 | / Ok(Self::post(&self) 484 | | .endpoint(endpoint) 485 | | .body(body) 486 | | .call() 487 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 483 ~ Self::post(&self) 484 | .endpoint(endpoint) 485 | .body(body) 486 | .call() 487 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:483:23 | 483 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:502:9 | 502 | / Ok(Self::post(&self) 503 | | .endpoint(endpoint) 504 | | .body(body) 505 | | .call() 506 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 502 ~ Self::post(&self) 503 | .endpoint(endpoint) 504 | .body(body) 505 | .call() 506 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:502:23 | 502 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:523:9 | 523 | / Ok(Self::post(&self) 524 | | .endpoint(endpoint) 525 | | .body(body) 526 | | .call() 527 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 523 ~ Self::post(&self) 524 | .endpoint(endpoint) 525 | .body(body) 526 | .call() 527 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:523:23 | 523 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:548:9 | 548 | / Ok(Self::post(&self) 549 | | .endpoint(endpoint) 550 | | .body(body) 551 | | .call() 552 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 548 ~ Self::post(&self) 549 | .endpoint(endpoint) 550 | .body(body) 551 | .call() 552 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:548:23 | 548 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:567:9 | 567 | / Ok(Self::post(&self) 568 | | .endpoint(endpoint) 569 | | .body(body) 570 | | .call() 571 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 567 ~ Self::post(&self) 568 | .endpoint(endpoint) 569 | .body(body) 570 | .call() 571 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:567:23 | 567 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:586:9 | 586 | / Ok(Self::post(&self) 587 | | .endpoint(endpoint) 588 | | .body(body) 589 | | .call() 590 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 586 ~ Self::post(&self) 587 | .endpoint(endpoint) 588 | .body(body) 589 | .call() 590 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:586:23 | 586 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:605:9 | 605 | / Ok(Self::post(&self) 606 | | .endpoint(endpoint) 607 | | .body(body) 608 | | .call() 609 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 605 ~ Self::post(&self) 606 | .endpoint(endpoint) 607 | .body(body) 608 | .call() 609 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:605:23 | 605 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:624:9 | 624 | / Ok(Self::post(&self) 625 | | .endpoint(endpoint) 626 | | .body(body) 627 | | .call() 628 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 624 ~ Self::post(&self) 625 | .endpoint(endpoint) 626 | .body(body) 627 | .call() 628 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:624:23 | 624 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:643:9 | 643 | / Ok(Self::post(&self) 644 | | .endpoint(endpoint) 645 | | .body(body) 646 | | .call() 647 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 643 ~ Self::post(&self) 644 | .endpoint(endpoint) 645 | .body(body) 646 | .call() 647 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:643:23 | 643 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:684:9 | 684 | / Ok(Self::post(&self) 685 | | .endpoint(endpoint) 686 | | .body(body) 687 | | .call() 688 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 684 ~ Self::post(&self) 685 | .endpoint(endpoint) 686 | .body(body) 687 | .call() 688 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:684:23 | 684 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:707:9 | 707 | / Ok(Self::post(&self) 708 | | .endpoint(endpoint) 709 | | .body(body) 710 | | .call() 711 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 707 ~ Self::post(&self) 708 | .endpoint(endpoint) 709 | .body(body) 710 | .call() 711 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:707:23 | 707 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:730:9 | 730 | / Ok(Self::post(&self) 731 | | .endpoint(endpoint) 732 | | .body(body) 733 | | .call() 734 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 730 ~ Self::post(&self) 731 | .endpoint(endpoint) 732 | .body(body) 733 | .call() 734 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:730:23 | 730 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:753:9 | 753 | / Ok(Self::post(&self) 754 | | .endpoint(endpoint) 755 | | .body(body) 756 | | .call() 757 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 753 ~ Self::post(&self) 754 | .endpoint(endpoint) 755 | .body(body) 756 | .call() 757 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:753:23 | 753 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:776:9 | 776 | / Ok(Self::post(&self) 777 | | .endpoint(endpoint) 778 | | .body(body) 779 | | .call() 780 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 776 ~ Self::post(&self) 777 | .endpoint(endpoint) 778 | .body(body) 779 | .call() 780 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:776:23 | 776 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:795:9 | 795 | / Ok(Self::post(&self) 796 | | .endpoint(endpoint) 797 | | .body(body) 798 | | .call() 799 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 795 ~ Self::post(&self) 796 | .endpoint(endpoint) 797 | .body(body) 798 | .call() 799 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:795:23 | 795 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: type parameter `T` goes unused in function definition --> src/lib.rs:804:31 | 804 | pub async fn get_site_user( | ^^^^^^^^^^^^^^^^^^^^^ help: consider removing the parameter | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters = note: `#[warn(clippy::extra_unused_type_parameters)]` on by default warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:812:9 | 812 | / Ok(Self::post(&self) 813 | | .endpoint(endpoint) 814 | | .body(body) 815 | | .call() 816 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 812 ~ Self::post(&self) 813 | .endpoint(endpoint) 814 | .body(body) 815 | .call() 816 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:812:23 | 812 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:841:9 | 841 | / Ok(Self::post(&self) 842 | | .endpoint(endpoint) 843 | | .body(body) 844 | | .call() 845 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 841 ~ Self::post(&self) 842 | .endpoint(endpoint) 843 | .body(body) 844 | .call() 845 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:841:23 | 841 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:858:9 | 858 | / Ok(Self::post(&self) 859 | | .endpoint(endpoint) 860 | | .body(body) 861 | | .call() 862 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 858 ~ Self::post(&self) 859 | .endpoint(endpoint) 860 | .body(body) 861 | .call() 862 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:858:23 | 858 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:875:9 | 875 | / Ok(Self::post(&self) 876 | | .endpoint(endpoint) 877 | | .body(body) 878 | | .call() 879 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 875 ~ Self::post(&self) 876 | .endpoint(endpoint) 877 | .body(body) 878 | .call() 879 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:875:23 | 875 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:892:9 | 892 | / Ok(Self::post(&self) 893 | | .endpoint(endpoint) 894 | | .body(body) 895 | | .call() 896 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 892 ~ Self::post(&self) 893 | .endpoint(endpoint) 894 | .body(body) 895 | .call() 896 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:892:23 | 892 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:909:9 | 909 | / Ok(Self::post(&self) 910 | | .endpoint(endpoint) 911 | | .body(body) 912 | | .call() 913 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 909 ~ Self::post(&self) 910 | .endpoint(endpoint) 911 | .body(body) 912 | .call() 913 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:909:23 | 909 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:926:9 | 926 | / Ok(Self::post(&self) 927 | | .endpoint(endpoint) 928 | | .body(body) 929 | | .call() 930 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 926 ~ Self::post(&self) 927 | .endpoint(endpoint) 928 | .body(body) 929 | .call() 930 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:926:23 | 926 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:943:9 | 943 | / Ok(Self::post(&self) 944 | | .endpoint(endpoint) 945 | | .body(body) 946 | | .call() 947 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 943 ~ Self::post(&self) 944 | .endpoint(endpoint) 945 | .body(body) 946 | .call() 947 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:943:23 | 943 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:960:9 | 960 | / Ok(Self::post(&self) 961 | | .endpoint(endpoint) 962 | | .body(body) 963 | | .call() 964 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 960 ~ Self::post(&self) 961 | .endpoint(endpoint) 962 | .body(body) 963 | .call() 964 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:960:23 | 960 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:977:9 | 977 | / Ok(Self::post(&self) 978 | | .endpoint(endpoint) 979 | | .body(body) 980 | | .call() 981 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 977 ~ Self::post(&self) 978 | .endpoint(endpoint) 979 | .body(body) 980 | .call() 981 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:977:23 | 977 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:994:9 | 994 | / Ok(Self::post(&self) 995 | | .endpoint(endpoint) 996 | | .body(body) 997 | | .call() 998 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 994 ~ Self::post(&self) 995 | .endpoint(endpoint) 996 | .body(body) 997 | .call() 998 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:994:23 | 994 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1011:9 | 1011 | / Ok(Self::post(&self) 1012 | | .endpoint(endpoint) 1013 | | .body(body) 1014 | | .call() 1015 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1011 ~ Self::post(&self) 1012 | .endpoint(endpoint) 1013 | .body(body) 1014 | .call() 1015 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1011:23 | 1011 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1028:9 | 1028 | / Ok(Self::post(&self) 1029 | | .endpoint(endpoint) 1030 | | .body(body) 1031 | | .call() 1032 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1028 ~ Self::post(&self) 1029 | .endpoint(endpoint) 1030 | .body(body) 1031 | .call() 1032 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1028:23 | 1028 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1045:9 | 1045 | / Ok(Self::post(&self) 1046 | | .endpoint(endpoint) 1047 | | .body(body) 1048 | | .call() 1049 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1045 ~ Self::post(&self) 1046 | .endpoint(endpoint) 1047 | .body(body) 1048 | .call() 1049 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1045:23 | 1045 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1062:9 | 1062 | / Ok(Self::post(&self) 1063 | | .endpoint(endpoint) 1064 | | .body(body) 1065 | | .call() 1066 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1062 ~ Self::post(&self) 1063 | .endpoint(endpoint) 1064 | .body(body) 1065 | .call() 1066 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1062:23 | 1062 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1079:9 | 1079 | / Ok(Self::post(&self) 1080 | | .endpoint(endpoint) 1081 | | .body(body) 1082 | | .call() 1083 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1079 ~ Self::post(&self) 1080 | .endpoint(endpoint) 1081 | .body(body) 1082 | .call() 1083 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1079:23 | 1079 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1096:9 | 1096 | / Ok(Self::post(&self) 1097 | | .endpoint(endpoint) 1098 | | .body(body) 1099 | | .call() 1100 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1096 ~ Self::post(&self) 1097 | .endpoint(endpoint) 1098 | .body(body) 1099 | .call() 1100 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1096:23 | 1096 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1115:9 | 1115 | / Ok(Self::post(&self) 1116 | | .endpoint(endpoint) 1117 | | .body(body) 1118 | | .call() 1119 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1115 ~ Self::post(&self) 1116 | .endpoint(endpoint) 1117 | .body(body) 1118 | .call() 1119 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1115:23 | 1115 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1132:9 | 1132 | / Ok(Self::post(&self) 1133 | | .endpoint(endpoint) 1134 | | .body(body) 1135 | | .call() 1136 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1132 ~ Self::post(&self) 1133 | .endpoint(endpoint) 1134 | .body(body) 1135 | .call() 1136 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1132:23 | 1132 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1149:9 | 1149 | / Ok(Self::post(&self) 1150 | | .endpoint(endpoint) 1151 | | .body(body) 1152 | | .call() 1153 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1149 ~ Self::post(&self) 1150 | .endpoint(endpoint) 1151 | .body(body) 1152 | .call() 1153 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1149:23 | 1149 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1166:9 | 1166 | / Ok(Self::post(&self) 1167 | | .endpoint(endpoint) 1168 | | .body(body) 1169 | | .call() 1170 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1166 ~ Self::post(&self) 1167 | .endpoint(endpoint) 1168 | .body(body) 1169 | .call() 1170 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1166:23 | 1166 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1183:9 | 1183 | / Ok(Self::post(&self) 1184 | | .endpoint(endpoint) 1185 | | .body(body) 1186 | | .call() 1187 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1183 ~ Self::post(&self) 1184 | .endpoint(endpoint) 1185 | .body(body) 1186 | .call() 1187 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1183:23 | 1183 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1200:9 | 1200 | / Ok(Self::post(&self) 1201 | | .endpoint(endpoint) 1202 | | .body(body) 1203 | | .call() 1204 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1200 ~ Self::post(&self) 1201 | .endpoint(endpoint) 1202 | .body(body) 1203 | .call() 1204 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1200:23 | 1200 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1217:9 | 1217 | / Ok(Self::post(&self) 1218 | | .endpoint(endpoint) 1219 | | .body(body) 1220 | | .call() 1221 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1217 ~ Self::post(&self) 1218 | .endpoint(endpoint) 1219 | .body(body) 1220 | .call() 1221 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1217:23 | 1217 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1234:9 | 1234 | / Ok(Self::post(&self) 1235 | | .endpoint(endpoint) 1236 | | .body(body) 1237 | | .call() 1238 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1234 ~ Self::post(&self) 1235 | .endpoint(endpoint) 1236 | .body(body) 1237 | .call() 1238 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1234:23 | 1234 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1259:9 | 1259 | / Ok(Self::post(&self) 1260 | | .endpoint(endpoint) 1261 | | .body(body) 1262 | | .call() 1263 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1259 ~ Self::post(&self) 1260 | .endpoint(endpoint) 1261 | .body(body) 1262 | .call() 1263 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1259:23 | 1259 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1276:9 | 1276 | / Ok(Self::post(&self) 1277 | | .endpoint(endpoint) 1278 | | .body(body) 1279 | | .call() 1280 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1276 ~ Self::post(&self) 1277 | .endpoint(endpoint) 1278 | .body(body) 1279 | .call() 1280 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1276:23 | 1276 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1293:9 | 1293 | / Ok(Self::post(&self) 1294 | | .endpoint(endpoint) 1295 | | .body(body) 1296 | | .call() 1297 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1293 ~ Self::post(&self) 1294 | .endpoint(endpoint) 1295 | .body(body) 1296 | .call() 1297 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1293:23 | 1293 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1371:9 | 1371 | / Ok(Self::post(&self) 1372 | | .endpoint(endpoint) 1373 | | .body(body) 1374 | | .call() 1375 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1371 ~ Self::post(&self) 1372 | .endpoint(endpoint) 1373 | .body(body) 1374 | .call() 1375 ~ .await | warning: this `if` statement can be collapsed --> src/lib.rs:1355:9 | 1355 | / if let Some(custom) = custom_fields { 1356 | | if custom.is_object() { 1357 | | let custom_temp_map = custom.as_object().unwrap(); 1358 | | custom_map.extend( ... | 1364 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if = note: `#[warn(clippy::collapsible_if)]` on by default help: collapse nested if block | 1355 ~ if let Some(custom) = custom_fields 1356 ~ && custom.is_object() { 1357 | let custom_temp_map = custom.as_object().unwrap(); ... 1362 | ); 1363 ~ } | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1371:23 | 1371 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1416:9 | 1416 | / Ok(Self::post(&self) 1417 | | .endpoint(endpoint) 1418 | | .body(body) 1419 | | .maybe_upload(upload) 1420 | | .call() 1421 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1416 ~ Self::post(&self) 1417 | .endpoint(endpoint) ... 1420 | .call() 1421 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1416:23 | 1416 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1442:9 | 1442 | / Ok(Self::post(&self) 1443 | | .endpoint(endpoint) 1444 | | .body(body) 1445 | | .call() 1446 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1442 ~ Self::post(&self) 1443 | .endpoint(endpoint) 1444 | .body(body) 1445 | .call() 1446 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1442:23 | 1442 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1463:9 | 1463 | / Ok(Self::post(&self) 1464 | | .endpoint(endpoint) 1465 | | .body(body) 1466 | | .call() 1467 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1463 ~ Self::post(&self) 1464 | .endpoint(endpoint) 1465 | .body(body) 1466 | .call() 1467 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1463:23 | 1463 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1482:9 | 1482 | / Ok(Self::post(&self) 1483 | | .endpoint(endpoint) 1484 | | .body(body) 1485 | | .call() 1486 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1482 ~ Self::post(&self) 1483 | .endpoint(endpoint) 1484 | .body(body) 1485 | .call() 1486 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1482:23 | 1482 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1505:9 | 1505 | / Ok(Self::post(&self) 1506 | | .endpoint(endpoint) 1507 | | .body(body) 1508 | | .call() 1509 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1505 ~ Self::post(&self) 1506 | .endpoint(endpoint) 1507 | .body(body) 1508 | .call() 1509 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1505:23 | 1505 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1528:9 | 1528 | / Ok(Self::post(&self) 1529 | | .endpoint(endpoint) 1530 | | .body(body) 1531 | | .call() 1532 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1528 ~ Self::post(&self) 1529 | .endpoint(endpoint) 1530 | .body(body) 1531 | .call() 1532 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1528:23 | 1528 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1549:9 | 1549 | / Ok(Self::post(&self) 1550 | | .endpoint(endpoint) 1551 | | .body(body) 1552 | | .call() 1553 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1549 ~ Self::post(&self) 1550 | .endpoint(endpoint) 1551 | .body(body) 1552 | .call() 1553 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1549:23 | 1549 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1588:9 | 1588 | / Ok(Self::post(&self) 1589 | | .endpoint(endpoint) 1590 | | .body(body) 1591 | | .call() 1592 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1588 ~ Self::post(&self) 1589 | .endpoint(endpoint) 1590 | .body(body) 1591 | .call() 1592 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1588:23 | 1588 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1623:9 | 1623 | / Ok(Self::post(&self) 1624 | | .endpoint(endpoint) 1625 | | .body(body) 1626 | | .call() 1627 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1623 ~ Self::post(&self) 1624 | .endpoint(endpoint) 1625 | .body(body) 1626 | .call() 1627 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1623:23 | 1623 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1656:9 | 1656 | / Ok(Self::post(&self) 1657 | | .endpoint(endpoint) 1658 | | .body(body) 1659 | | .call() 1660 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1656 ~ Self::post(&self) 1657 | .endpoint(endpoint) 1658 | .body(body) 1659 | .call() 1660 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1656:23 | 1656 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1677:9 | 1677 | / Ok(Self::post(&self) 1678 | | .endpoint(endpoint) 1679 | | .body(body) 1680 | | .call() 1681 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1677 ~ Self::post(&self) 1678 | .endpoint(endpoint) 1679 | .body(body) 1680 | .call() 1681 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1677:23 | 1677 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1696:9 | 1696 | / Ok(Self::post(&self) 1697 | | .endpoint(endpoint) 1698 | | .body(body) 1699 | | .call() 1700 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1696 ~ Self::post(&self) 1697 | .endpoint(endpoint) 1698 | .body(body) 1699 | .call() 1700 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1696:23 | 1696 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1715:9 | 1715 | / Ok(Self::post(&self) 1716 | | .endpoint(endpoint) 1717 | | .body(body) 1718 | | .call() 1719 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1715 ~ Self::post(&self) 1716 | .endpoint(endpoint) 1717 | .body(body) 1718 | .call() 1719 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1715:23 | 1715 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1732:9 | 1732 | / Ok(Self::post(&self) 1733 | | .endpoint(endpoint) 1734 | | .body(body) 1735 | | .call() 1736 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1732 ~ Self::post(&self) 1733 | .endpoint(endpoint) 1734 | .body(body) 1735 | .call() 1736 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1732:23 | 1732 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1749:9 | 1749 | / Ok(Self::post(&self) 1750 | | .endpoint(endpoint) 1751 | | .body(body) 1752 | | .call() 1753 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1749 ~ Self::post(&self) 1750 | .endpoint(endpoint) 1751 | .body(body) 1752 | .call() 1753 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1749:23 | 1749 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1770:9 | 1770 | / Ok(Self::post(&self) 1771 | | .endpoint(endpoint) 1772 | | .body(body) 1773 | | .call() 1774 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1770 ~ Self::post(&self) 1771 | .endpoint(endpoint) 1772 | .body(body) 1773 | .call() 1774 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1770:23 | 1770 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1791:9 | 1791 | / Ok(Self::post(&self) 1792 | | .endpoint(endpoint) 1793 | | .body(body) 1794 | | .call() 1795 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1791 ~ Self::post(&self) 1792 | .endpoint(endpoint) 1793 | .body(body) 1794 | .call() 1795 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1791:23 | 1791 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1808:9 | 1808 | / Ok(Self::post(&self) 1809 | | .endpoint(endpoint) 1810 | | .body(body) 1811 | | .call() 1812 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1808 ~ Self::post(&self) 1809 | .endpoint(endpoint) 1810 | .body(body) 1811 | .call() 1812 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1808:23 | 1808 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1827:9 | 1827 | / Ok(Self::post(&self) 1828 | | .endpoint(endpoint) 1829 | | .body(body) 1830 | | .call() 1831 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1827 ~ Self::post(&self) 1828 | .endpoint(endpoint) 1829 | .body(body) 1830 | .call() 1831 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1827:23 | 1827 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1874:9 | 1874 | / Ok(Self::post(&self) 1875 | | .endpoint(endpoint) 1876 | | .body(body) 1877 | | .maybe_upload(upload) 1878 | | .call() 1879 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1874 ~ Self::post(&self) 1875 | .endpoint(endpoint) ... 1878 | .call() 1879 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1874:23 | 1874 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1902:9 | 1902 | / Ok(Self::post(&self) 1903 | | .endpoint(endpoint) 1904 | | .body(body) 1905 | | .call() 1906 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1902 ~ Self::post(&self) 1903 | .endpoint(endpoint) 1904 | .body(body) 1905 | .call() 1906 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1902:23 | 1902 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:1921:9 | 1921 | / Ok(Self::post(&self) 1922 | | .endpoint(endpoint) 1923 | | .body(body) 1924 | | .call() 1925 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 1921 ~ Self::post(&self) 1922 | .endpoint(endpoint) 1923 | .body(body) 1924 | .call() 1925 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:1921:23 | 1921 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2001:9 | 2001 | / Ok(Self::post(&self) 2002 | | .endpoint(endpoint) 2003 | | .body(body) 2004 | | .call() 2005 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2001 ~ Self::post(&self) 2002 | .endpoint(endpoint) 2003 | .body(body) 2004 | .call() 2005 ~ .await | warning: this `if` statement can be collapsed --> src/lib.rs:1985:9 | 1985 | / if let Some(custom) = custom_fields { 1986 | | if custom.is_object() { 1987 | | let custom_temp_map = custom.as_object().unwrap(); 1988 | | custom_map.extend( ... | 1994 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if help: collapse nested if block | 1985 ~ if let Some(custom) = custom_fields 1986 ~ && custom.is_object() { 1987 | let custom_temp_map = custom.as_object().unwrap(); ... 1992 | ); 1993 ~ } | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2001:23 | 2001 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2024:9 | 2024 | / Ok(Self::post(&self) 2025 | | .endpoint(endpoint) 2026 | | .body(body) 2027 | | .call() 2028 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2024 ~ Self::post(&self) 2025 | .endpoint(endpoint) 2026 | .body(body) 2027 | .call() 2028 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2024:23 | 2024 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2043:9 | 2043 | / Ok(Self::post(&self) 2044 | | .endpoint(endpoint) 2045 | | .body(body) 2046 | | .call() 2047 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2043 ~ Self::post(&self) 2044 | .endpoint(endpoint) 2045 | .body(body) 2046 | .call() 2047 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2043:23 | 2043 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2066:9 | 2066 | / Ok(Self::post(&self) 2067 | | .endpoint(endpoint) 2068 | | .body(body) 2069 | | .call() 2070 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2066 ~ Self::post(&self) 2067 | .endpoint(endpoint) 2068 | .body(body) 2069 | .call() 2070 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2066:23 | 2066 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2105:9 | 2105 | / Ok(Self::post(&self) 2106 | | .endpoint(endpoint) 2107 | | .body(body) 2108 | | .call() 2109 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2105 ~ Self::post(&self) 2106 | .endpoint(endpoint) 2107 | .body(body) 2108 | .call() 2109 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2105:23 | 2105 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2138:9 | 2138 | / Ok(Self::post(&self) 2139 | | .endpoint(endpoint) 2140 | | .body(body) 2141 | | .call() 2142 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2138 ~ Self::post(&self) 2139 | .endpoint(endpoint) 2140 | .body(body) 2141 | .call() 2142 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2138:23 | 2138 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2171:9 | 2171 | / Ok(Self::post(&self) 2172 | | .endpoint(endpoint) 2173 | | .body(body) 2174 | | .call() 2175 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2171 ~ Self::post(&self) 2172 | .endpoint(endpoint) 2173 | .body(body) 2174 | .call() 2175 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2171:23 | 2171 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2204:9 | 2204 | / Ok(Self::post(&self) 2205 | | .endpoint(endpoint) 2206 | | .body(body) 2207 | | .call() 2208 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2204 ~ Self::post(&self) 2205 | .endpoint(endpoint) 2206 | .body(body) 2207 | .call() 2208 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2204:23 | 2204 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2221:9 | 2221 | / Ok(Self::post(&self) 2222 | | .endpoint(endpoint) 2223 | | .body(body) 2224 | | .call() 2225 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2221 ~ Self::post(&self) 2222 | .endpoint(endpoint) 2223 | .body(body) 2224 | .call() 2225 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2221:23 | 2221 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2242:9 | 2242 | / Ok(Self::post(&self) 2243 | | .endpoint(endpoint) 2244 | | .body(body) 2245 | | .call() 2246 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2242 ~ Self::post(&self) 2243 | .endpoint(endpoint) 2244 | .body(body) 2245 | .call() 2246 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2242:23 | 2242 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2259:9 | 2259 | / Ok(Self::post(&self) 2260 | | .endpoint(endpoint) 2261 | | .body(body) 2262 | | .call() 2263 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2259 ~ Self::post(&self) 2260 | .endpoint(endpoint) 2261 | .body(body) 2262 | .call() 2263 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2259:23 | 2259 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2280:9 | 2280 | / Ok(Self::post(&self) 2281 | | .endpoint(endpoint) 2282 | | .body(body) 2283 | | .call() 2284 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2280 ~ Self::post(&self) 2281 | .endpoint(endpoint) 2282 | .body(body) 2283 | .call() 2284 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2280:23 | 2280 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2299:9 | 2299 | / Ok(Self::post(&self) 2300 | | .endpoint(endpoint) 2301 | | .body(body) 2302 | | .call() 2303 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2299 ~ Self::post(&self) 2300 | .endpoint(endpoint) 2301 | .body(body) 2302 | .call() 2303 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2299:23 | 2299 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2318:9 | 2318 | / Ok(Self::post(&self) 2319 | | .endpoint(endpoint) 2320 | | .body(body) 2321 | | .call() 2322 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2318 ~ Self::post(&self) 2319 | .endpoint(endpoint) 2320 | .body(body) 2321 | .call() 2322 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2318:23 | 2318 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2337:9 | 2337 | / Ok(Self::post(&self) 2338 | | .endpoint(endpoint) 2339 | | .body(body) 2340 | | .call() 2341 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2337 ~ Self::post(&self) 2338 | .endpoint(endpoint) 2339 | .body(body) 2340 | .call() 2341 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2337:23 | 2337 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2356:9 | 2356 | / Ok(Self::post(&self) 2357 | | .endpoint(endpoint) 2358 | | .body(body) 2359 | | .call() 2360 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2356 ~ Self::post(&self) 2357 | .endpoint(endpoint) 2358 | .body(body) 2359 | .call() 2360 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2356:23 | 2356 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2389:9 | 2389 | / Ok(Self::post(&self) 2390 | | .endpoint(endpoint) 2391 | | .body(body) 2392 | | .call() 2393 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2389 ~ Self::post(&self) 2390 | .endpoint(endpoint) 2391 | .body(body) 2392 | .call() 2393 ~ .await | warning: this `if` statement can be collapsed --> src/lib.rs:2373:9 | 2373 | / if let Some(options_obj) = options { 2374 | | if options_obj.is_object() { 2375 | | let custom_temp_map = options_obj.as_object().unwrap(); 2376 | | custom_map.extend( ... | 2382 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if help: collapse nested if block | 2373 ~ if let Some(options_obj) = options 2374 ~ && options_obj.is_object() { 2375 | let custom_temp_map = options_obj.as_object().unwrap(); ... 2380 | ); 2381 ~ } | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2389:23 | 2389 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2469:9 | 2469 | / Ok(Self::post(&self) 2470 | | .endpoint(endpoint) 2471 | | .body(body) 2472 | | .call() 2473 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2469 ~ Self::post(&self) 2470 | .endpoint(endpoint) 2471 | .body(body) 2472 | .call() 2473 ~ .await | warning: this `if` statement can be collapsed --> src/lib.rs:2453:9 | 2453 | / if let Some(custom) = custom_fields { 2454 | | if custom.is_object() { 2455 | | let custom_temp_map = custom.as_object().unwrap(); 2456 | | custom_map.extend( ... | 2462 | | } | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if help: collapse nested if block | 2453 ~ if let Some(custom) = custom_fields 2454 ~ && custom.is_object() { 2455 | let custom_temp_map = custom.as_object().unwrap(); ... 2460 | ); 2461 ~ } | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2469:23 | 2469 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2516:9 | 2516 | / Ok(Self::post(&self) 2517 | | .endpoint(endpoint) 2518 | | .body(body) 2519 | | .maybe_upload(upload) 2520 | | .call() 2521 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2516 ~ Self::post(&self) 2517 | .endpoint(endpoint) ... 2520 | .call() 2521 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2516:23 | 2516 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2556:9 | 2556 | / Ok(Self::post(&self) 2557 | | .endpoint(endpoint) 2558 | | .body(body) 2559 | | .call() 2560 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2556 ~ Self::post(&self) 2557 | .endpoint(endpoint) 2558 | .body(body) 2559 | .call() 2560 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2556:23 | 2556 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2589:9 | 2589 | / Ok(Self::post(&self) 2590 | | .endpoint(endpoint) 2591 | | .body(body) 2592 | | .call() 2593 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2589 ~ Self::post(&self) 2590 | .endpoint(endpoint) 2591 | .body(body) 2592 | .call() 2593 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2589:23 | 2589 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2622:9 | 2622 | / Ok(Self::post(&self) 2623 | | .endpoint(endpoint) 2624 | | .body(body) 2625 | | .call() 2626 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2622 ~ Self::post(&self) 2623 | .endpoint(endpoint) 2624 | .body(body) 2625 | .call() 2626 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2622:23 | 2622 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2639:9 | 2639 | / Ok(Self::post(&self) 2640 | | .endpoint(endpoint) 2641 | | .body(body) 2642 | | .call() 2643 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2639 ~ Self::post(&self) 2640 | .endpoint(endpoint) 2641 | .body(body) 2642 | .call() 2643 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2639:23 | 2639 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2656:9 | 2656 | / Ok(Self::post(&self) 2657 | | .endpoint(endpoint) 2658 | | .body(body) 2659 | | .call() 2660 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2656 ~ Self::post(&self) 2657 | .endpoint(endpoint) 2658 | .body(body) 2659 | .call() 2660 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2656:23 | 2656 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2673:9 | 2673 | / Ok(Self::post(&self) 2674 | | .endpoint(endpoint) 2675 | | .body(body) 2676 | | .call() 2677 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2673 ~ Self::post(&self) 2674 | .endpoint(endpoint) 2675 | .body(body) 2676 | .call() 2677 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2673:23 | 2673 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2690:9 | 2690 | / Ok(Self::post(&self) 2691 | | .endpoint(endpoint) 2692 | | .body(body) 2693 | | .call() 2694 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2690 ~ Self::post(&self) 2691 | .endpoint(endpoint) 2692 | .body(body) 2693 | .call() 2694 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2690:23 | 2690 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2707:9 | 2707 | / Ok(Self::post(&self) 2708 | | .endpoint(endpoint) 2709 | | .body(body) 2710 | | .call() 2711 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2707 ~ Self::post(&self) 2708 | .endpoint(endpoint) 2709 | .body(body) 2710 | .call() 2711 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2707:23 | 2707 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2724:9 | 2724 | / Ok(Self::post(&self) 2725 | | .endpoint(endpoint) 2726 | | .body(body) 2727 | | .call() 2728 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2724 ~ Self::post(&self) 2725 | .endpoint(endpoint) 2726 | .body(body) 2727 | .call() 2728 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2724:23 | 2724 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2745:9 | 2745 | / Ok(Self::post(&self) 2746 | | .endpoint(endpoint) 2747 | | .body(body) 2748 | | .call() 2749 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2745 ~ Self::post(&self) 2746 | .endpoint(endpoint) 2747 | .body(body) 2748 | .call() 2749 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2745:23 | 2745 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2766:9 | 2766 | / Ok(Self::post(&self) 2767 | | .endpoint(endpoint) 2768 | | .body(body) 2769 | | .call() 2770 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2766 ~ Self::post(&self) 2767 | .endpoint(endpoint) 2768 | .body(body) 2769 | .call() 2770 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2766:23 | 2766 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2785:9 | 2785 | / Ok(Self::post(&self) 2786 | | .endpoint(endpoint) 2787 | | .body(body) 2788 | | .call() 2789 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2785 ~ Self::post(&self) 2786 | .endpoint(endpoint) 2787 | .body(body) 2788 | .call() 2789 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2785:23 | 2785 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2802:9 | 2802 | / Ok(Self::post(&self) 2803 | | .endpoint(endpoint) 2804 | | .body(body) 2805 | | .call() 2806 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2802 ~ Self::post(&self) 2803 | .endpoint(endpoint) 2804 | .body(body) 2805 | .call() 2806 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2802:23 | 2802 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2819:9 | 2819 | / Ok(Self::post(&self) 2820 | | .endpoint(endpoint) 2821 | | .body(body) 2822 | | .call() 2823 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2819 ~ Self::post(&self) 2820 | .endpoint(endpoint) 2821 | .body(body) 2822 | .call() 2823 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2819:23 | 2819 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2836:9 | 2836 | / Ok(Self::post(&self) 2837 | | .endpoint(endpoint) 2838 | | .body(body) 2839 | | .call() 2840 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2836 ~ Self::post(&self) 2837 | .endpoint(endpoint) 2838 | .body(body) 2839 | .call() 2840 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2836:23 | 2836 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2853:9 | 2853 | / Ok(Self::post(&self) 2854 | | .endpoint(endpoint) 2855 | | .body(body) 2856 | | .call() 2857 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2853 ~ Self::post(&self) 2854 | .endpoint(endpoint) 2855 | .body(body) 2856 | .call() 2857 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2853:23 | 2853 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2870:9 | 2870 | / Ok(Self::post(&self) 2871 | | .endpoint(endpoint) 2872 | | .body(body) 2873 | | .call() 2874 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2870 ~ Self::post(&self) 2871 | .endpoint(endpoint) 2872 | .body(body) 2873 | .call() 2874 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2870:23 | 2870 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2887:9 | 2887 | / Ok(Self::post(&self) 2888 | | .endpoint(endpoint) 2889 | | .body(body) 2890 | | .call() 2891 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2887 ~ Self::post(&self) 2888 | .endpoint(endpoint) 2889 | .body(body) 2890 | .call() 2891 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2887:23 | 2887 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2906:9 | 2906 | / Ok(Self::post(&self) 2907 | | .endpoint(endpoint) 2908 | | .body(body) 2909 | | .call() 2910 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2906 ~ Self::post(&self) 2907 | .endpoint(endpoint) 2908 | .body(body) 2909 | .call() 2910 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2906:23 | 2906 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2923:9 | 2923 | / Ok(Self::post(&self) 2924 | | .endpoint(endpoint) 2925 | | .body(body) 2926 | | .call() 2927 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2923 ~ Self::post(&self) 2924 | .endpoint(endpoint) 2925 | .body(body) 2926 | .call() 2927 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2923:23 | 2923 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2940:9 | 2940 | / Ok(Self::post(&self) 2941 | | .endpoint(endpoint) 2942 | | .body(body) 2943 | | .call() 2944 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2940 ~ Self::post(&self) 2941 | .endpoint(endpoint) 2942 | .body(body) 2943 | .call() 2944 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2940:23 | 2940 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2959:9 | 2959 | / Ok(Self::post(&self) 2960 | | .endpoint(endpoint) 2961 | | .body(body) 2962 | | .call() 2963 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2959 ~ Self::post(&self) 2960 | .endpoint(endpoint) 2961 | .body(body) 2962 | .call() 2963 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2959:23 | 2959 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2978:9 | 2978 | / Ok(Self::post(&self) 2979 | | .endpoint(endpoint) 2980 | | .body(body) 2981 | | .call() 2982 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2978 ~ Self::post(&self) 2979 | .endpoint(endpoint) 2980 | .body(body) 2981 | .call() 2982 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2978:23 | 2978 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:2995:9 | 2995 | / Ok(Self::post(&self) 2996 | | .endpoint(endpoint) 2997 | | .body(body) 2998 | | .call() 2999 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 2995 ~ Self::post(&self) 2996 | .endpoint(endpoint) 2997 | .body(body) 2998 | .call() 2999 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:2995:23 | 2995 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:3012:9 | 3012 | / Ok(Self::post(&self) 3013 | | .endpoint(endpoint) 3014 | | .body(body) 3015 | | .call() 3016 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 3012 ~ Self::post(&self) 3013 | .endpoint(endpoint) 3014 | .body(body) 3015 | .call() 3016 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:3012:23 | 3012 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:3029:9 | 3029 | / Ok(Self::post(&self) 3030 | | .endpoint(endpoint) 3031 | | .body(body) 3032 | | .call() 3033 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 3029 ~ Self::post(&self) 3030 | .endpoint(endpoint) 3031 | .body(body) 3032 | .call() 3033 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:3029:23 | 3029 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: enclosing `Ok` and `?` operator are unneeded --> src/lib.rs:3048:9 | 3048 | / Ok(Self::post(&self) 3049 | | .endpoint(endpoint) 3050 | | .body(body) 3051 | | .call() 3052 | | .await?) | |____________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark help: remove the enclosing `Ok` and `?` operator | 3048 ~ Self::post(&self) 3049 | .endpoint(endpoint) 3050 | .body(body) 3051 | .call() 3052 ~ .await | warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/lib.rs:3048:23 | 3048 | Ok(Self::post(&self) | ^^^^^ help: change this to: `self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow warning: `ckanaction` (lib) generated 271 warnings (run `cargo clippy --fix --lib -p ckanaction` to apply 271 suggestions) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.24s --- src/lib.rs | 547 ++++++++++++++++++++++++++--------------------------- 1 file changed, 271 insertions(+), 276 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4ef57c0..d168708 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,9 +20,8 @@ fn opsert<'a, T: serde::ser::Serialize>( ) { if value.is_some() { map.insert(name, json!(value)); - () - } else { - }; + + } ; } fn hashmap_to_json( @@ -95,11 +94,11 @@ impl CKAN { opsert("limit", limit, &mut map); opsert("offset", offset, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.current_package_list_with_resources @@ -116,11 +115,11 @@ impl CKAN { opsert("offset", offset, &mut map); opsert("page", page, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.member_list @@ -137,11 +136,11 @@ impl CKAN { opsert("object_type", object_type, &mut map); opsert("capacity", capacity, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.package_collaborator_list @@ -156,11 +155,11 @@ impl CKAN { map.insert("id", json!(id)); opsert("capacity", capacity, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.package_collaborator_list_for_user @@ -175,11 +174,11 @@ impl CKAN { map.insert("id", json!(id)); opsert("capacity", capacity, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_list @@ -214,11 +213,11 @@ impl CKAN { opsert("include_groups", include_groups, &mut map); opsert("include_users", include_users, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_list @@ -253,11 +252,11 @@ impl CKAN { opsert("include_groups", include_groups, &mut map); opsert("include_users", include_users, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_list_authz @@ -272,11 +271,11 @@ impl CKAN { opsert("available_only", available_only, &mut map); opsert("am_member", am_member, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_list_for_user @@ -293,18 +292,18 @@ impl CKAN { opsert("permission", permission, &mut map); opsert("include_dataset_count", include_dataset_count, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.license_list #[builder] pub async fn license_list(&self) -> Result> { let endpoint = self.url.clone() + "/api/3/action/license_list"; - Ok(Self::post(&self).endpoint(endpoint).call().await?) + Self::post(self).endpoint(endpoint).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.tag_list @@ -321,11 +320,11 @@ impl CKAN { opsert("vocabulary_id", vocabulary_id, &mut map); opsert("all_fields", all_fields, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_list @@ -346,11 +345,11 @@ impl CKAN { opsert("all_fields", all_fields, &mut map); opsert("include_site_user", include_site_user, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.package_relationships_list @@ -367,11 +366,11 @@ impl CKAN { map.insert("id2", json!(id2)); opsert("rel", rel, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.resource_show @@ -384,11 +383,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.resource_view_show @@ -401,11 +400,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.resource_view_list @@ -418,11 +417,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_show @@ -449,11 +448,11 @@ impl CKAN { opsert("include_tags", include_tags, &mut map); opsert("include_followers", include_followers, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_show @@ -480,11 +479,11 @@ impl CKAN { opsert("include_tags", include_tags, &mut map); opsert("include_followers", include_followers, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_package_show @@ -499,11 +498,11 @@ impl CKAN { map.insert("id", json!(id)); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.tag_show @@ -520,11 +519,11 @@ impl CKAN { opsert("vocabulary_id", vocabulary_id, &mut map); opsert("include_datasets", include_datasets, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_show @@ -545,11 +544,11 @@ impl CKAN { opsert("include_password_hash", include_password_hash, &mut map); opsert("include_plugin_extras", include_plugin_extras, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.package_autocomplete @@ -564,11 +563,11 @@ impl CKAN { map.insert("q", json!(q)); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.format_autocomplete @@ -583,11 +582,11 @@ impl CKAN { map.insert("q", json!(q)); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_autocomplete @@ -602,11 +601,11 @@ impl CKAN { map.insert("q", json!(q)); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_autocomplete @@ -621,11 +620,11 @@ impl CKAN { map.insert("q", json!(q)); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_autocomplete @@ -640,11 +639,11 @@ impl CKAN { map.insert("q", json!(q)); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.package_search @@ -681,11 +680,11 @@ impl CKAN { opsert("include_private", include_private, &mut map); opsert("use_default_schema", use_default_schema, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.resource_search @@ -704,11 +703,11 @@ impl CKAN { opsert("offset", offset, &mut map); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.tag_search @@ -727,11 +726,11 @@ impl CKAN { opsert("limit", limit, &mut map); opsert("offset", offset, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.tag_autocomplete @@ -750,11 +749,11 @@ impl CKAN { opsert("limit", limit, &mut map); opsert("offset", offset, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.task_status_show @@ -773,11 +772,11 @@ impl CKAN { opsert("task_type", task_type, &mut map); opsert("key", key, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.term_translation_show @@ -792,16 +791,16 @@ impl CKAN { opsert("terms", terms, &mut map); opsert("lang_codes", lang_codes, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.get_site_user #[builder] - pub async fn get_site_user( + pub async fn get_site_user( &self, defer_commit: Option, ) -> Result> { @@ -809,23 +808,23 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); opsert("defer_commit", defer_commit, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.status_show pub async fn status_show(&self) -> Result> { let endpoint = self.url.clone() + "/api/3/action/status_show"; - Ok(Self::get(&self, endpoint).await?) + Self::get(self, endpoint).await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.vocabulary_list pub async fn vocabulary_list(&self) -> Result> { let endpoint = self.url.clone() + "/api/3/action/vocabulary_list"; - Ok(Self::get(&self, endpoint).await?) + Self::get(self, endpoint).await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.vocabulary_show @@ -838,11 +837,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_follower_count @@ -855,11 +854,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.dataset_follower_count @@ -872,11 +871,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_follower_count @@ -889,11 +888,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_follower_count @@ -906,11 +905,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_follower_list @@ -923,11 +922,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.dataset_follower_list @@ -940,11 +939,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_follower_list @@ -957,11 +956,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.am_following_user @@ -974,11 +973,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.am_following_dataset @@ -991,11 +990,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.am_following_group @@ -1008,11 +1007,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.followee_count @@ -1025,11 +1024,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_followee_count @@ -1042,11 +1041,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.dataset_followee_count @@ -1059,11 +1058,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_followee_count @@ -1076,11 +1075,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_followee_count @@ -1093,11 +1092,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.followee_list @@ -1112,11 +1111,11 @@ impl CKAN { map.insert("id", json!(id)); opsert("q", q, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_followee_list @@ -1129,11 +1128,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.dataset_followee_list @@ -1146,11 +1145,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_followee_list @@ -1163,11 +1162,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_followee_list @@ -1180,11 +1179,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.member_roles_list @@ -1197,11 +1196,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); opsert("group_type", group_type, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.help_show @@ -1214,11 +1213,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("name", json!(name)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.config_option_show @@ -1231,11 +1230,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("key", json!(key)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.config_option_list @@ -1243,7 +1242,7 @@ impl CKAN { &self, ) -> Result> { let endpoint = self.url.clone() + "/api/3/action/config_option_list"; - Ok(Self::get(&self, endpoint).await?) + Self::get(self, endpoint).await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.job_list @@ -1256,11 +1255,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); opsert("queues", queues, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.job_show @@ -1273,11 +1272,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.api_token_list @@ -1290,11 +1289,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("user_id", json!(user_id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.package_create @@ -1352,8 +1351,8 @@ impl CKAN { let mut custom_map: HashMap = HashMap::new(); opsert("groups", groups, &mut map); opsert("owner_org", owner_org, &mut map); - if let Some(custom) = custom_fields { - if custom.is_object() { + if let Some(custom) = custom_fields + && custom.is_object() { let custom_temp_map = custom.as_object().unwrap(); custom_map.extend( custom_temp_map @@ -1361,18 +1360,17 @@ impl CKAN { .map(|item| (item.0.to_owned(), item.1.to_owned())), ); } - } map.extend( custom_map .iter() .map(|item| (item.0.as_str(), item.1.to_owned())), ); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.resource_create @@ -1413,12 +1411,12 @@ impl CKAN { opsert("cache_last_updated", cache_last_updated, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .maybe_upload(upload) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.resource_view_create @@ -1439,11 +1437,11 @@ impl CKAN { map.insert("view_type", json!(view_type)); opsert("config", config, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.create_default_resource_views @@ -1460,11 +1458,11 @@ impl CKAN { opsert("package", package, &mut map); opsert("create_datastore_views", create_datastore_views, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.package_create_default_resource_views @@ -1479,11 +1477,11 @@ impl CKAN { map.insert("package", package); opsert("create_datastore_views", create_datastore_views, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.package_relationship_create @@ -1502,11 +1500,11 @@ impl CKAN { map.insert("type", json!(_type)); opsert("comment", comment, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.member_create @@ -1525,11 +1523,11 @@ impl CKAN { map.insert("object_type", json!(object_type)); map.insert("capacity", json!(capacity)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.package_collaborator_create @@ -1546,11 +1544,11 @@ impl CKAN { map.insert("user_id", json!(user_id)); map.insert("capacity", json!(capacity)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.group_create @@ -1585,11 +1583,11 @@ impl CKAN { opsert("groups", groups, &mut map); opsert("users", users, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.organization_create @@ -1620,11 +1618,11 @@ impl CKAN { opsert("packages", packages, &mut map); opsert("users", users, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.user_create @@ -1653,11 +1651,11 @@ impl CKAN { opsert("plugin_extras", plugin_extras, &mut map); opsert("with_apitoken", with_apitoken, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.user_invite @@ -1674,11 +1672,11 @@ impl CKAN { map.insert("group_id", json!(group_id)); map.insert("role", json!(role)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.vocabulary_create @@ -1693,11 +1691,11 @@ impl CKAN { map.insert("name", json!(name)); map.insert("tags", json!(tags)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.tag_create @@ -1712,11 +1710,11 @@ impl CKAN { map.insert("name", json!(name)); map.insert("vocabulary_id", json!(vocabulary_id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.follow_user @@ -1729,11 +1727,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.follow_dataset @@ -1746,11 +1744,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.group_member_create @@ -1767,11 +1765,11 @@ impl CKAN { map.insert("username", json!(username)); map.insert("role", json!(role)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.organization_member_create @@ -1788,11 +1786,11 @@ impl CKAN { map.insert("username", json!(username)); map.insert("role", json!(role)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.follow_group @@ -1805,11 +1803,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.api_token_create @@ -1824,11 +1822,11 @@ impl CKAN { map.insert("user", json!(user)); map.insert("name", json!(name)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.resource_update @@ -1871,12 +1869,12 @@ impl CKAN { opsert("cache_last_updated", cache_last_updated, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .maybe_upload(upload) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.resource_view_update @@ -1899,11 +1897,11 @@ impl CKAN { map.insert("view_type", json!(view_type)); opsert("config", config, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.resource_view_reorder @@ -1918,11 +1916,11 @@ impl CKAN { map.insert("id", json!(id)); map.insert("order", json!(order)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.package_update @@ -1982,8 +1980,8 @@ impl CKAN { let mut custom_map: HashMap = HashMap::new(); opsert("groups", groups, &mut map); opsert("owner_org", owner_org, &mut map); - if let Some(custom) = custom_fields { - if custom.is_object() { + if let Some(custom) = custom_fields + && custom.is_object() { let custom_temp_map = custom.as_object().unwrap(); custom_map.extend( custom_temp_map @@ -1991,18 +1989,17 @@ impl CKAN { .map(|item| (item.0.to_owned(), item.1.to_owned())), ); } - } map.extend( custom_map .iter() .map(|item| (item.0.as_str(), item.1.to_owned())), ); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.package_revise @@ -2021,11 +2018,11 @@ impl CKAN { map.insert("update", update); opsert("include", include, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.package_resource_reorder @@ -2040,11 +2037,11 @@ impl CKAN { map.insert("id", json!(id)); map.insert("order", json!(order)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.package_relationship_update @@ -2063,11 +2060,11 @@ impl CKAN { map.insert("type", json!(_type)); opsert("comment", comment, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.group_update @@ -2102,11 +2099,11 @@ impl CKAN { opsert("groups", groups, &mut map); opsert("users", users, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.organization_update @@ -2135,11 +2132,11 @@ impl CKAN { opsert("extras", extras, &mut map); opsert("users", users, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.user_update @@ -2168,11 +2165,11 @@ impl CKAN { opsert("plugin_extras", plugin_extras, &mut map); opsert("with_apitoken", with_apitoken, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.task_status_update @@ -2201,11 +2198,11 @@ impl CKAN { opsert("last_updated", last_updated, &mut map); opsert("error", error, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.task_status_update_many @@ -2218,11 +2215,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("data", json!(data)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.term_translation_update @@ -2239,11 +2236,11 @@ impl CKAN { map.insert("term_translation", json!(term_translation)); map.insert("lang_code", json!(lang_code)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.term_translation_update_many @@ -2256,11 +2253,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("data", json!(data)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.vocabulary_update @@ -2277,11 +2274,11 @@ impl CKAN { map.insert("name", json!(name)); map.insert("tags", json!(tags)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.package_owner_org_update @@ -2296,11 +2293,11 @@ impl CKAN { map.insert("id", json!(id)); map.insert("organization_id", json!(organization_id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.bulk_update_private @@ -2315,11 +2312,11 @@ impl CKAN { map.insert("datasets", json!(datasets)); map.insert("org_id", json!(org_id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.bulk_update_public @@ -2334,11 +2331,11 @@ impl CKAN { map.insert("datasets", json!(datasets)); map.insert("org_id", json!(org_id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.bulk_update_delete @@ -2353,11 +2350,11 @@ impl CKAN { map.insert("datasets", json!(datasets)); map.insert("org_id", json!(org_id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } // TODO: Verify proper parameters @@ -2370,8 +2367,8 @@ impl CKAN { let endpoint = self.url.clone() + "/api/3/action/config_option_update"; let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); let mut custom_map: HashMap = HashMap::new(); - if let Some(options_obj) = options { - if options_obj.is_object() { + if let Some(options_obj) = options + && options_obj.is_object() { let custom_temp_map = options_obj.as_object().unwrap(); custom_map.extend( custom_temp_map @@ -2379,18 +2376,17 @@ impl CKAN { .map(|item| (item.0.to_owned(), item.1.to_owned())), ); } - } map.extend( custom_map .iter() .map(|item| (item.0.as_str(), item.1.to_owned())), ); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.patch.package_patch @@ -2450,8 +2446,8 @@ impl CKAN { let mut custom_map: HashMap = HashMap::new(); opsert("groups", groups, &mut map); opsert("owner_org", owner_org, &mut map); - if let Some(custom) = custom_fields { - if custom.is_object() { + if let Some(custom) = custom_fields + && custom.is_object() { let custom_temp_map = custom.as_object().unwrap(); custom_map.extend( custom_temp_map @@ -2459,18 +2455,17 @@ impl CKAN { .map(|item| (item.0.to_owned(), item.1.to_owned())), ); } - } map.extend( custom_map .iter() .map(|item| (item.0.as_str(), item.1.to_owned())), ); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.patch.resource_patch @@ -2513,12 +2508,12 @@ impl CKAN { opsert("cache_last_updated", cache_last_updated, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .maybe_upload(upload) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.group_patch @@ -2553,11 +2548,11 @@ impl CKAN { opsert("groups", groups, &mut map); opsert("users", users, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.patch.organization_patch @@ -2586,11 +2581,11 @@ impl CKAN { opsert("extras", extras, &mut map); opsert("users", users, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.patch.user_patch @@ -2619,11 +2614,11 @@ impl CKAN { opsert("plugin_extras", plugin_extras, &mut map); opsert("with_apitoken", with_apitoken, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.user_delete @@ -2636,11 +2631,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.package_delete @@ -2653,11 +2648,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.dataset_purge @@ -2670,11 +2665,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.resource_delete @@ -2687,11 +2682,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.resource_view_delete @@ -2704,11 +2699,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.resource_view_clear @@ -2721,11 +2716,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); opsert("view_types", view_types, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.package_relationship_delete @@ -2742,11 +2737,11 @@ impl CKAN { map.insert("object", json!(object)); map.insert("type", json!(_type)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.member_delete @@ -2763,11 +2758,11 @@ impl CKAN { map.insert("object", json!(object)); map.insert("object_type", json!(object_type)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.package_collaborator_delete @@ -2782,11 +2777,11 @@ impl CKAN { map.insert("id", json!(id)); map.insert("user_id", json!(user_id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.group_delete @@ -2799,11 +2794,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.organization_delete @@ -2816,11 +2811,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.group_purge @@ -2833,11 +2828,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.organization_purge @@ -2850,11 +2845,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.task_status_delete @@ -2867,11 +2862,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.vocabulary_delete @@ -2884,11 +2879,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.tag_delete @@ -2903,11 +2898,11 @@ impl CKAN { map.insert("id", json!(id)); map.insert("vocabulary_id", json!(vocabulary_id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.unfollow_user @@ -2920,11 +2915,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.unfollow_dataset @@ -2937,11 +2932,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.group_member_delete @@ -2956,11 +2951,11 @@ impl CKAN { map.insert("id", json!(id)); map.insert("username", json!(username)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.organization_member_delete @@ -2975,11 +2970,11 @@ impl CKAN { map.insert("id", json!(id)); map.insert("username", json!(username)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.unfollow_group @@ -2992,11 +2987,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.job_clear @@ -3009,11 +3004,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); opsert("queues", queues, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.job_cancel @@ -3026,11 +3021,11 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.api_token_revoke @@ -3045,10 +3040,10 @@ impl CKAN { map.insert("token", json!(token)); opsert("jti", jti, &mut map); let body = hashmap_to_json(&map)?; - Ok(Self::post(&self) + Self::post(self) .endpoint(endpoint) .body(body) .call() - .await?) + .await } } From 661638a406beaf429d2b282d68ee05eebb06deda Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Tue, 27 May 2025 10:49:09 -0400 Subject: [PATCH 04/29] refactor: change unstable let chains to nested if cargo t Compiling ckanaction v0.1.0 (/Users/joelnatividad/GitHub/ckanaction) error[E0658]: `let` expressions in this position are unstable --> src/lib.rs:1354:12 | 1354 | if let Some(custom) = custom_fields | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #53667 for more information error[E0658]: `let` expressions in this position are unstable --> src/lib.rs:1983:12 | 1983 | if let Some(custom) = custom_fields | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #53667 for more information error[E0658]: `let` expressions in this position are unstable --> src/lib.rs:2370:12 | 2370 | if let Some(options_obj) = options | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #53667 for more information error[E0658]: `let` expressions in this position are unstable --> src/lib.rs:2449:12 | 2449 | if let Some(custom) = custom_fields | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #53667 for more information For more information about this error, try `rustc --explain E0658`. error: could not compile `ckanaction` (lib test) due to 4 previous errors warning: build failed, waiting for other jobs to finish... error: could not compile `ckanaction` (lib) due to 4 previous errors --- src/lib.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d168708..043a66d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1351,8 +1351,8 @@ impl CKAN { let mut custom_map: HashMap = HashMap::new(); opsert("groups", groups, &mut map); opsert("owner_org", owner_org, &mut map); - if let Some(custom) = custom_fields - && custom.is_object() { + if let Some(custom) = custom_fields { + if custom.is_object() { let custom_temp_map = custom.as_object().unwrap(); custom_map.extend( custom_temp_map @@ -1360,6 +1360,7 @@ impl CKAN { .map(|item| (item.0.to_owned(), item.1.to_owned())), ); } + } map.extend( custom_map .iter() @@ -1980,8 +1981,8 @@ impl CKAN { let mut custom_map: HashMap = HashMap::new(); opsert("groups", groups, &mut map); opsert("owner_org", owner_org, &mut map); - if let Some(custom) = custom_fields - && custom.is_object() { + if let Some(custom) = custom_fields { + if custom.is_object() { let custom_temp_map = custom.as_object().unwrap(); custom_map.extend( custom_temp_map @@ -1989,6 +1990,7 @@ impl CKAN { .map(|item| (item.0.to_owned(), item.1.to_owned())), ); } + } map.extend( custom_map .iter() @@ -2367,8 +2369,8 @@ impl CKAN { let endpoint = self.url.clone() + "/api/3/action/config_option_update"; let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); let mut custom_map: HashMap = HashMap::new(); - if let Some(options_obj) = options - && options_obj.is_object() { + if let Some(options_obj) = options { + if options_obj.is_object() { let custom_temp_map = options_obj.as_object().unwrap(); custom_map.extend( custom_temp_map @@ -2376,6 +2378,7 @@ impl CKAN { .map(|item| (item.0.to_owned(), item.1.to_owned())), ); } + } map.extend( custom_map .iter() @@ -2446,8 +2449,8 @@ impl CKAN { let mut custom_map: HashMap = HashMap::new(); opsert("groups", groups, &mut map); opsert("owner_org", owner_org, &mut map); - if let Some(custom) = custom_fields - && custom.is_object() { + if let Some(custom) = custom_fields { + if custom.is_object() { let custom_temp_map = custom.as_object().unwrap(); custom_map.extend( custom_temp_map @@ -2455,6 +2458,7 @@ impl CKAN { .map(|item| (item.0.to_owned(), item.1.to_owned())), ); } + } map.extend( custom_map .iter() From 2670ed5b20e241da986203b085d70b5a6e5d7212 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Tue, 27 May 2025 10:49:43 -0400 Subject: [PATCH 05/29] chore: rust fmt --- src/lib.rs | 753 +++++++++-------------------------------------------- 1 file changed, 126 insertions(+), 627 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 043a66d..e021be2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,8 +20,7 @@ fn opsert<'a, T: serde::ser::Serialize>( ) { if value.is_some() { map.insert(name, json!(value)); - - } ; + }; } fn hashmap_to_json( @@ -94,11 +93,7 @@ impl CKAN { opsert("limit", limit, &mut map); opsert("offset", offset, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.current_package_list_with_resources @@ -115,11 +110,7 @@ impl CKAN { opsert("offset", offset, &mut map); opsert("page", page, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.member_list @@ -136,11 +127,7 @@ impl CKAN { opsert("object_type", object_type, &mut map); opsert("capacity", capacity, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.package_collaborator_list @@ -155,11 +142,7 @@ impl CKAN { map.insert("id", json!(id)); opsert("capacity", capacity, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.package_collaborator_list_for_user @@ -174,11 +157,7 @@ impl CKAN { map.insert("id", json!(id)); opsert("capacity", capacity, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_list @@ -213,11 +192,7 @@ impl CKAN { opsert("include_groups", include_groups, &mut map); opsert("include_users", include_users, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_list @@ -252,11 +227,7 @@ impl CKAN { opsert("include_groups", include_groups, &mut map); opsert("include_users", include_users, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_list_authz @@ -271,11 +242,7 @@ impl CKAN { opsert("available_only", available_only, &mut map); opsert("am_member", am_member, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_list_for_user @@ -292,11 +259,7 @@ impl CKAN { opsert("permission", permission, &mut map); opsert("include_dataset_count", include_dataset_count, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.license_list @@ -320,11 +283,7 @@ impl CKAN { opsert("vocabulary_id", vocabulary_id, &mut map); opsert("all_fields", all_fields, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_list @@ -345,11 +304,7 @@ impl CKAN { opsert("all_fields", all_fields, &mut map); opsert("include_site_user", include_site_user, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.package_relationships_list @@ -366,11 +321,7 @@ impl CKAN { map.insert("id2", json!(id2)); opsert("rel", rel, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.resource_show @@ -383,11 +334,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.resource_view_show @@ -400,11 +347,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.resource_view_list @@ -417,11 +360,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_show @@ -448,11 +387,7 @@ impl CKAN { opsert("include_tags", include_tags, &mut map); opsert("include_followers", include_followers, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_show @@ -479,11 +414,7 @@ impl CKAN { opsert("include_tags", include_tags, &mut map); opsert("include_followers", include_followers, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_package_show @@ -498,11 +429,7 @@ impl CKAN { map.insert("id", json!(id)); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.tag_show @@ -519,11 +446,7 @@ impl CKAN { opsert("vocabulary_id", vocabulary_id, &mut map); opsert("include_datasets", include_datasets, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_show @@ -544,11 +467,7 @@ impl CKAN { opsert("include_password_hash", include_password_hash, &mut map); opsert("include_plugin_extras", include_plugin_extras, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.package_autocomplete @@ -563,11 +482,7 @@ impl CKAN { map.insert("q", json!(q)); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.format_autocomplete @@ -582,11 +497,7 @@ impl CKAN { map.insert("q", json!(q)); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_autocomplete @@ -601,11 +512,7 @@ impl CKAN { map.insert("q", json!(q)); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_autocomplete @@ -620,11 +527,7 @@ impl CKAN { map.insert("q", json!(q)); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_autocomplete @@ -639,11 +542,7 @@ impl CKAN { map.insert("q", json!(q)); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.package_search @@ -680,11 +579,7 @@ impl CKAN { opsert("include_private", include_private, &mut map); opsert("use_default_schema", use_default_schema, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.resource_search @@ -703,11 +598,7 @@ impl CKAN { opsert("offset", offset, &mut map); opsert("limit", limit, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.tag_search @@ -726,11 +617,7 @@ impl CKAN { opsert("limit", limit, &mut map); opsert("offset", offset, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.tag_autocomplete @@ -749,11 +636,7 @@ impl CKAN { opsert("limit", limit, &mut map); opsert("offset", offset, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.task_status_show @@ -772,11 +655,7 @@ impl CKAN { opsert("task_type", task_type, &mut map); opsert("key", key, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.term_translation_show @@ -791,11 +670,7 @@ impl CKAN { opsert("terms", terms, &mut map); opsert("lang_codes", lang_codes, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.get_site_user @@ -808,11 +683,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); opsert("defer_commit", defer_commit, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.status_show @@ -837,11 +708,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_follower_count @@ -854,11 +721,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.dataset_follower_count @@ -871,11 +734,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_follower_count @@ -888,11 +747,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_follower_count @@ -905,11 +760,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_follower_list @@ -922,11 +773,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.dataset_follower_list @@ -939,11 +786,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_follower_list @@ -956,11 +799,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.am_following_user @@ -973,11 +812,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.am_following_dataset @@ -990,11 +825,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.am_following_group @@ -1007,11 +838,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.followee_count @@ -1024,11 +851,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_followee_count @@ -1041,11 +864,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.dataset_followee_count @@ -1058,11 +877,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_followee_count @@ -1075,11 +890,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_followee_count @@ -1092,11 +903,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.followee_list @@ -1111,11 +918,7 @@ impl CKAN { map.insert("id", json!(id)); opsert("q", q, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.user_followee_list @@ -1128,11 +931,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.dataset_followee_list @@ -1145,11 +944,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.group_followee_list @@ -1162,11 +957,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.organization_followee_list @@ -1179,11 +970,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.member_roles_list @@ -1196,11 +983,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); opsert("group_type", group_type, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.help_show @@ -1213,11 +996,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("name", json!(name)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.config_option_show @@ -1230,11 +1009,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("key", json!(key)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.config_option_list @@ -1255,11 +1030,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); opsert("queues", queues, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.job_show @@ -1272,11 +1043,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.get.api_token_list @@ -1289,11 +1056,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("user_id", json!(user_id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.package_create @@ -1367,11 +1130,7 @@ impl CKAN { .map(|item| (item.0.as_str(), item.1.to_owned())), ); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.resource_create @@ -1438,11 +1197,7 @@ impl CKAN { map.insert("view_type", json!(view_type)); opsert("config", config, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.create_default_resource_views @@ -1459,11 +1214,7 @@ impl CKAN { opsert("package", package, &mut map); opsert("create_datastore_views", create_datastore_views, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.package_create_default_resource_views @@ -1478,11 +1229,7 @@ impl CKAN { map.insert("package", package); opsert("create_datastore_views", create_datastore_views, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.package_relationship_create @@ -1501,11 +1248,7 @@ impl CKAN { map.insert("type", json!(_type)); opsert("comment", comment, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.member_create @@ -1524,11 +1267,7 @@ impl CKAN { map.insert("object_type", json!(object_type)); map.insert("capacity", json!(capacity)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.package_collaborator_create @@ -1545,11 +1284,7 @@ impl CKAN { map.insert("user_id", json!(user_id)); map.insert("capacity", json!(capacity)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.group_create @@ -1584,11 +1319,7 @@ impl CKAN { opsert("groups", groups, &mut map); opsert("users", users, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.organization_create @@ -1619,11 +1350,7 @@ impl CKAN { opsert("packages", packages, &mut map); opsert("users", users, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.user_create @@ -1652,11 +1379,7 @@ impl CKAN { opsert("plugin_extras", plugin_extras, &mut map); opsert("with_apitoken", with_apitoken, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.user_invite @@ -1673,11 +1396,7 @@ impl CKAN { map.insert("group_id", json!(group_id)); map.insert("role", json!(role)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.vocabulary_create @@ -1692,11 +1411,7 @@ impl CKAN { map.insert("name", json!(name)); map.insert("tags", json!(tags)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.tag_create @@ -1711,11 +1426,7 @@ impl CKAN { map.insert("name", json!(name)); map.insert("vocabulary_id", json!(vocabulary_id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.follow_user @@ -1728,11 +1439,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.follow_dataset @@ -1745,11 +1452,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.group_member_create @@ -1766,11 +1469,7 @@ impl CKAN { map.insert("username", json!(username)); map.insert("role", json!(role)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.organization_member_create @@ -1787,11 +1486,7 @@ impl CKAN { map.insert("username", json!(username)); map.insert("role", json!(role)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.follow_group @@ -1804,11 +1499,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.create.api_token_create @@ -1823,11 +1514,7 @@ impl CKAN { map.insert("user", json!(user)); map.insert("name", json!(name)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.resource_update @@ -1898,11 +1585,7 @@ impl CKAN { map.insert("view_type", json!(view_type)); opsert("config", config, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.resource_view_reorder @@ -1917,11 +1600,7 @@ impl CKAN { map.insert("id", json!(id)); map.insert("order", json!(order)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.package_update @@ -1997,11 +1676,7 @@ impl CKAN { .map(|item| (item.0.as_str(), item.1.to_owned())), ); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.package_revise @@ -2020,11 +1695,7 @@ impl CKAN { map.insert("update", update); opsert("include", include, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.package_resource_reorder @@ -2039,11 +1710,7 @@ impl CKAN { map.insert("id", json!(id)); map.insert("order", json!(order)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.package_relationship_update @@ -2062,11 +1729,7 @@ impl CKAN { map.insert("type", json!(_type)); opsert("comment", comment, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.group_update @@ -2101,11 +1764,7 @@ impl CKAN { opsert("groups", groups, &mut map); opsert("users", users, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.organization_update @@ -2134,11 +1793,7 @@ impl CKAN { opsert("extras", extras, &mut map); opsert("users", users, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.user_update @@ -2167,11 +1822,7 @@ impl CKAN { opsert("plugin_extras", plugin_extras, &mut map); opsert("with_apitoken", with_apitoken, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.task_status_update @@ -2200,11 +1851,7 @@ impl CKAN { opsert("last_updated", last_updated, &mut map); opsert("error", error, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.task_status_update_many @@ -2217,11 +1864,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("data", json!(data)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.term_translation_update @@ -2238,11 +1881,7 @@ impl CKAN { map.insert("term_translation", json!(term_translation)); map.insert("lang_code", json!(lang_code)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.term_translation_update_many @@ -2255,11 +1894,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("data", json!(data)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.vocabulary_update @@ -2276,11 +1911,7 @@ impl CKAN { map.insert("name", json!(name)); map.insert("tags", json!(tags)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.package_owner_org_update @@ -2295,11 +1926,7 @@ impl CKAN { map.insert("id", json!(id)); map.insert("organization_id", json!(organization_id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.bulk_update_private @@ -2314,11 +1941,7 @@ impl CKAN { map.insert("datasets", json!(datasets)); map.insert("org_id", json!(org_id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.bulk_update_public @@ -2333,11 +1956,7 @@ impl CKAN { map.insert("datasets", json!(datasets)); map.insert("org_id", json!(org_id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.update.bulk_update_delete @@ -2352,11 +1971,7 @@ impl CKAN { map.insert("datasets", json!(datasets)); map.insert("org_id", json!(org_id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } // TODO: Verify proper parameters @@ -2385,11 +2000,7 @@ impl CKAN { .map(|item| (item.0.as_str(), item.1.to_owned())), ); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.patch.package_patch @@ -2465,11 +2076,7 @@ impl CKAN { .map(|item| (item.0.as_str(), item.1.to_owned())), ); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.patch.resource_patch @@ -2552,11 +2159,7 @@ impl CKAN { opsert("groups", groups, &mut map); opsert("users", users, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.patch.organization_patch @@ -2585,11 +2188,7 @@ impl CKAN { opsert("extras", extras, &mut map); opsert("users", users, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.patch.user_patch @@ -2618,11 +2217,7 @@ impl CKAN { opsert("plugin_extras", plugin_extras, &mut map); opsert("with_apitoken", with_apitoken, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.user_delete @@ -2635,11 +2230,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.package_delete @@ -2652,11 +2243,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.dataset_purge @@ -2669,11 +2256,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.resource_delete @@ -2686,11 +2269,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.resource_view_delete @@ -2703,11 +2282,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.resource_view_clear @@ -2720,11 +2295,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); opsert("view_types", view_types, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.package_relationship_delete @@ -2741,11 +2312,7 @@ impl CKAN { map.insert("object", json!(object)); map.insert("type", json!(_type)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.member_delete @@ -2762,11 +2329,7 @@ impl CKAN { map.insert("object", json!(object)); map.insert("object_type", json!(object_type)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.package_collaborator_delete @@ -2781,11 +2344,7 @@ impl CKAN { map.insert("id", json!(id)); map.insert("user_id", json!(user_id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.group_delete @@ -2798,11 +2357,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.organization_delete @@ -2815,11 +2370,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.group_purge @@ -2832,11 +2383,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.organization_purge @@ -2849,11 +2396,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.task_status_delete @@ -2866,11 +2409,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.vocabulary_delete @@ -2883,11 +2422,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.tag_delete @@ -2902,11 +2437,7 @@ impl CKAN { map.insert("id", json!(id)); map.insert("vocabulary_id", json!(vocabulary_id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.unfollow_user @@ -2919,11 +2450,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.unfollow_dataset @@ -2936,11 +2463,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.group_member_delete @@ -2955,11 +2478,7 @@ impl CKAN { map.insert("id", json!(id)); map.insert("username", json!(username)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.organization_member_delete @@ -2974,11 +2493,7 @@ impl CKAN { map.insert("id", json!(id)); map.insert("username", json!(username)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.unfollow_group @@ -2991,11 +2506,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.job_clear @@ -3008,11 +2519,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); opsert("queues", queues, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.job_cancel @@ -3025,11 +2532,7 @@ impl CKAN { let mut map: HashMap<&str, serde_json::Value> = HashMap::new(); map.insert("id", json!(id)); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } /// https://docs.ckan.org/en/2.11/api/index.html#ckan.logic.action.delete.api_token_revoke @@ -3044,10 +2547,6 @@ impl CKAN { map.insert("token", json!(token)); opsert("jti", jti, &mut map); let body = hashmap_to_json(&map)?; - Self::post(self) - .endpoint(endpoint) - .body(body) - .call() - .await + Self::post(self).endpoint(endpoint).body(body).call().await } } From 66b28fd3f9d0b7cbee780d1fef4bd385985d6916 Mon Sep 17 00:00:00 2001 From: rzmk <30333942+rzmk@users.noreply.github.com> Date: Tue, 27 May 2025 14:09:16 -0400 Subject: [PATCH 06/29] feat: add first test with tokio dev-dep --- Cargo.lock | 76 ++++++++++++++++++++++++++++++++++++++++++++++-- Cargo.toml | 3 ++ tests/general.rs | 26 +++++++++++++++++ 3 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 tests/general.rs diff --git a/Cargo.lock b/Cargo.lock index 9a6ee56..62eb8e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,6 +116,7 @@ dependencies = [ "reqwest", "serde", "serde_json", + "tokio", ] [[package]] @@ -664,6 +665,16 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.27" @@ -788,6 +799,29 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -846,6 +880,15 @@ version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" +[[package]] +name = "redox_syscall" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +dependencies = [ + "bitflags", +] + [[package]] name = "reqwest" version = "0.12.15" @@ -986,6 +1029,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "security-framework" version = "2.11.1" @@ -1059,6 +1108,15 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook-registry" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +dependencies = [ + "libc", +] + [[package]] name = "slab" version = "0.4.9" @@ -1179,19 +1237,33 @@ dependencies = [ [[package]] name = "tokio" -version = "1.44.2" +version = "1.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", "bytes", "libc", "mio", + "parking_lot", "pin-project-lite", + "signal-hook-registry", "socket2", + "tokio-macros", "windows-sys 0.52.0", ] +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tokio-native-tls" version = "0.3.1" diff --git a/Cargo.toml b/Cargo.toml index b249681..a327141 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,3 +13,6 @@ bon = "3.6.3" reqwest = { version = "0.12.15", features = ["json", "multipart", "stream"] } serde = "1.0.219" serde_json = "1.0.140" + +[dev-dependencies] +tokio = { version = "1.45.1", features = ["full"] } diff --git a/tests/general.rs b/tests/general.rs new file mode 100644 index 0000000..30feeae --- /dev/null +++ b/tests/general.rs @@ -0,0 +1,26 @@ +use ckanaction::CKAN; + +const CKAN_API_TOKEN: &str = ""; +const CKAN_URL: &str = ""; + +pub async fn get_ckan_builder() -> CKAN { + CKAN::builder() + .token(CKAN_API_TOKEN.to_string()) + .url(CKAN_URL) + .build() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[tokio::test] + async fn status_show() -> Result<(), Box> { + let ckan = get_ckan_builder().await; + let response = ckan.status_show().await?; + assert!(response.is_object()); + let success = response.as_object().unwrap().get("success").unwrap().as_bool().unwrap(); + assert!(success); + Ok(()) + } +} From 1db8b34ddc4ee7093922a4e9bc42342266cc7f61 Mon Sep 17 00:00:00 2001 From: rzmk <30333942+rzmk@users.noreply.github.com> Date: Tue, 27 May 2025 14:10:28 -0400 Subject: [PATCH 07/29] docs: add running tests instructions to README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 628a496..6237136 100644 --- a/README.md +++ b/README.md @@ -81,3 +81,11 @@ println!("{status_show:#?}"); ## Notes - If you use a `maybe_fn()` then if you provide `None` it will be ignored and that parameter will not be added to the JSON body. This library assumes `None` would not be provided as a value (since the cases where it is a value is often the default value that the CKAN API already has set for that parameter). + +## Tests + +To run the tests in the `tests` directory, first replace the values for `CKAN_API_TOKEN` and `CKAN_URL` then run: + +```bash +cargo test +``` From 945fc6dca16afa6b87bfd562fddcd9eb7ec6c832 Mon Sep 17 00:00:00 2001 From: Mueez Khan <30333942+rzmk@users.noreply.github.com> Date: Wed, 27 Aug 2025 13:39:25 -0400 Subject: [PATCH 08/29] feat: add LICENSE --- LICENSE | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..fdddb29 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to From 39c573a5a4351ca41b2a7188ab1917be2a56a7ff Mon Sep 17 00:00:00 2001 From: rzmk <30333942+rzmk@users.noreply.github.com> Date: Sun, 12 Oct 2025 16:26:21 -0400 Subject: [PATCH 09/29] feat(docs): initial interactive ckanaction docs web app --- docs/.gitignore | 28 + docs/README.md | 31 + docs/app/(home)/layout.tsx | 6 + docs/app/(home)/page.tsx | 19 + docs/app/api/search/route.ts | 7 + docs/app/docs/[[...slug]]/page.tsx | 54 ++ docs/app/docs/layout.tsx | 11 + docs/app/global.css | 5 + docs/app/layout.tsx | 26 + docs/app/llms-full.txt/route.ts | 10 + docs/app/og/docs/[...slug]/route.tsx | 36 ++ docs/biome.json | 34 ++ docs/bun.lock | 858 +++++++++++++++++++++++++++ docs/content/docs/index.mdx | 38 ++ docs/content/docs/package_list.mdx | 18 + docs/content/docs/status_show.mdx | 18 + docs/lib/layout.shared.tsx | 24 + docs/lib/openapi.ts | 39 ++ docs/lib/openapi.yml | 87 +++ docs/lib/source.ts | 28 + docs/mdx-components.tsx | 13 + docs/next.config.mjs | 10 + docs/package.json | 36 ++ docs/postcss.config.mjs | 5 + docs/scripts/generate-docs.ts | 10 + docs/source.config.ts | 26 + docs/tsconfig.json | 30 + 27 files changed, 1507 insertions(+) create mode 100644 docs/.gitignore create mode 100644 docs/README.md create mode 100644 docs/app/(home)/layout.tsx create mode 100644 docs/app/(home)/page.tsx create mode 100644 docs/app/api/search/route.ts create mode 100644 docs/app/docs/[[...slug]]/page.tsx create mode 100644 docs/app/docs/layout.tsx create mode 100644 docs/app/global.css create mode 100644 docs/app/layout.tsx create mode 100644 docs/app/llms-full.txt/route.ts create mode 100644 docs/app/og/docs/[...slug]/route.tsx create mode 100644 docs/biome.json create mode 100644 docs/bun.lock create mode 100644 docs/content/docs/index.mdx create mode 100644 docs/content/docs/package_list.mdx create mode 100644 docs/content/docs/status_show.mdx create mode 100644 docs/lib/layout.shared.tsx create mode 100644 docs/lib/openapi.ts create mode 100644 docs/lib/openapi.yml create mode 100644 docs/lib/source.ts create mode 100644 docs/mdx-components.tsx create mode 100644 docs/next.config.mjs create mode 100644 docs/package.json create mode 100644 docs/postcss.config.mjs create mode 100644 docs/scripts/generate-docs.ts create mode 100644 docs/source.config.ts create mode 100644 docs/tsconfig.json diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..55a12ae --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,28 @@ +# deps +/node_modules + +# generated content +.contentlayer +.content-collections +.source + +# test & build +/coverage +/.next/ +/out/ +/build +*.tsbuildinfo + +# misc +.DS_Store +*.pem +/.pnp +.pnp.js +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# others +.env*.local +.vercel +next-env.d.ts \ No newline at end of file diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..9a83d6d --- /dev/null +++ b/docs/README.md @@ -0,0 +1,31 @@ +# ckan-action docs website (ckanaction.dathere.com) + +This directory includes a Next.js project built with [Fumadocs](https://github.com/fuma-nama/fumadocs) for documentation of ckanaction. The documentation can be viewed at [ckanaction.dathere.com](https://ckanaction.dathere.com). + +## Development + +Run development server: + +```bash +bun dev +``` + +Open http://localhost:3000 with your browser to see the result. + +## Explore + +In the project, you can see: + +- `lib/source.ts`: Code for content source adapter, `loader()` provides the interface to access your content. +- `lib/layout.shared.tsx`: Shared options for layouts, optional but preferred to keep. +- `lib/openapi.yml`: The source file of the CKAN Actions API (v3) in an OpenAPI format which is then used in a script by running `bun ./scripts/generate-docs.ts` to generate the relevant docs files in `content/docs`. + +| Route | Description | +| ------------------------- | ------------------------------------------------------ | +| `app/(home)` | The route group for your landing page and other pages. | +| `app/docs` | The documentation layout and pages. | +| `app/api/search/route.ts` | The Route Handler for search. | + +## Linting + +We use [Biome](https://biomejs.dev) for linting. We recommend you install the [biome-vscode extension](https://github.com/biomejs/biome-vscode) if you are using [VSCodium](https://vscodium.com/) or VSCode for developing the docs. diff --git a/docs/app/(home)/layout.tsx b/docs/app/(home)/layout.tsx new file mode 100644 index 0000000..77379fa --- /dev/null +++ b/docs/app/(home)/layout.tsx @@ -0,0 +1,6 @@ +import { HomeLayout } from 'fumadocs-ui/layouts/home'; +import { baseOptions } from '@/lib/layout.shared'; + +export default function Layout({ children }: LayoutProps<'/'>) { + return {children}; +} diff --git a/docs/app/(home)/page.tsx b/docs/app/(home)/page.tsx new file mode 100644 index 0000000..2478c1e --- /dev/null +++ b/docs/app/(home)/page.tsx @@ -0,0 +1,19 @@ +import Link from 'next/link'; + +export default function HomePage() { + return ( +
+

ckanaction

+

+ You can open{' '} + + /docs + {' '} + and see the interactive documentation. +

+
+ ); +} diff --git a/docs/app/api/search/route.ts b/docs/app/api/search/route.ts new file mode 100644 index 0000000..7ba7e82 --- /dev/null +++ b/docs/app/api/search/route.ts @@ -0,0 +1,7 @@ +import { source } from '@/lib/source'; +import { createFromSource } from 'fumadocs-core/search/server'; + +export const { GET } = createFromSource(source, { + // https://docs.orama.com/docs/orama-js/supported-languages + language: 'english', +}); diff --git a/docs/app/docs/[[...slug]]/page.tsx b/docs/app/docs/[[...slug]]/page.tsx new file mode 100644 index 0000000..9b6d208 --- /dev/null +++ b/docs/app/docs/[[...slug]]/page.tsx @@ -0,0 +1,54 @@ +import { getPageImage, source } from '@/lib/source'; +import { + DocsBody, + DocsDescription, + DocsPage, + DocsTitle, +} from 'fumadocs-ui/page'; +import { notFound } from 'next/navigation'; +import { getMDXComponents } from '@/mdx-components'; +import type { Metadata } from 'next'; +import { createRelativeLink } from 'fumadocs-ui/mdx'; + +export default async function Page(props: PageProps<'/docs/[[...slug]]'>) { + const params = await props.params; + const page = source.getPage(params.slug); + if (!page) notFound(); + + const MDX = page.data.body; + + return ( + + {page.data.title} + {page.data.description} + + + + + ); +} + +export async function generateStaticParams() { + return source.generateParams(); +} + +export async function generateMetadata( + props: PageProps<'/docs/[[...slug]]'>, +): Promise { + const params = await props.params; + const page = source.getPage(params.slug); + if (!page) notFound(); + + return { + title: page.data.title, + description: page.data.description, + openGraph: { + images: getPageImage(page).url, + }, + }; +} diff --git a/docs/app/docs/layout.tsx b/docs/app/docs/layout.tsx new file mode 100644 index 0000000..8e9ec72 --- /dev/null +++ b/docs/app/docs/layout.tsx @@ -0,0 +1,11 @@ +import { DocsLayout } from 'fumadocs-ui/layouts/docs'; +import { baseOptions } from '@/lib/layout.shared'; +import { source } from '@/lib/source'; + +export default function Layout({ children }: LayoutProps<'/docs'>) { + return ( + + {children} + + ); +} diff --git a/docs/app/global.css b/docs/app/global.css new file mode 100644 index 0000000..7d105b7 --- /dev/null +++ b/docs/app/global.css @@ -0,0 +1,5 @@ +@import 'tailwindcss'; +@import 'fumadocs-ui/css/neutral.css'; +@import 'fumadocs-ui/css/preset.css'; +@import 'fumadocs-openapi/css/preset.css'; + diff --git a/docs/app/layout.tsx b/docs/app/layout.tsx new file mode 100644 index 0000000..6dde91d --- /dev/null +++ b/docs/app/layout.tsx @@ -0,0 +1,26 @@ +import '@/app/global.css'; +import { RootProvider } from 'fumadocs-ui/provider/next'; +import { Inter } from 'next/font/google'; +import Script from "next/script"; + +const inter = Inter({ + subsets: ['latin'], +}); + +export default function Layout({ children }: LayoutProps<'/'>) { + return ( + + + {children} +