summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakka <jakka@jakka.su>2025-09-09 10:13:40 +0300
committerjakka <jakka@jakka.su>2025-09-09 10:13:40 +0300
commitab6f2caa83e05a2eaff40307f608975841ba6cfb (patch)
tree2bb0648f09abe6f25d5ee86d876d52c6577d3e21
parent3884a14c7dde671a96695f43a23bfbb2bd6c33e5 (diff)
continued working on api
-rw-r--r--Cargo.lock1
-rw-r--r--Cargo.toml1
-rw-r--r--src/client.rs4
-rw-r--r--src/lib.rs4
-rw-r--r--src/tests.rs4
-rw-r--r--src/types.rs1
6 files changed, 6 insertions, 9 deletions
diff --git a/Cargo.lock b/Cargo.lock
index e9cd70b..c449b96 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -122,7 +122,6 @@ checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
name = "hydrus-api-rs"
version = "0.1.0"
dependencies = [
- "http",
"musli",
"thiserror",
"ureq",
diff --git a/Cargo.toml b/Cargo.toml
index 5838ba5..18d1186 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,7 +4,6 @@ version = "0.1.0"
edition = "2024"
[dependencies]
-http = "1.3.1"
musli = { version = "0.0.145", features = ["json"] }
thiserror = "2.0.16"
ureq = "3.1.0"
diff --git a/src/client.rs b/src/client.rs
index 4847db8..49d903e 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -32,7 +32,7 @@ impl HydrusClient {
) -> Result<String> {
let mut req_url = self.url.to_owned();
req_url.push_str("request_new_permissions?name=");
- req_url.push_str(&urlencoding::encode(&name));
+ req_url.push_str(&urlencoding::encode(name));
if permissions.is_empty() {
req_url.push_str("&permit_everything=true");
@@ -83,7 +83,7 @@ impl HydrusClient {
pub fn get_service_name(&self, name: &str) -> Result<Service> {
let mut req_url = self.url.to_owned();
req_url.push_str("get_service?service_name=");
- req_url.push_str(&urlencoding::encode(&name));
+ req_url.push_str(&urlencoding::encode(name));
let response = if let Some(key) = &self.sessionkey {
ureq::get(req_url)
.header("Hydrus-Client-API-Access-Key", key)
diff --git a/src/lib.rs b/src/lib.rs
index b755f83..6d0b411 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,5 @@
pub mod client;
-mod tests;
pub mod types;
+
+#[cfg(test)]
+mod tests;
diff --git a/src/tests.rs b/src/tests.rs
index d22dedd..3fafdbe 100644
--- a/src/tests.rs
+++ b/src/tests.rs
@@ -1,8 +1,6 @@
use crate::client::HydrusClient;
-use http::Uri;
-
-#[cfg(test)]
use crate::types::*;
+
#[test]
fn correct_hydruspermissions_url_encode() {
let perms: [HydrusPermissions; 3] = [
diff --git a/src/types.rs b/src/types.rs
index 2cf1524..5472906 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -26,7 +26,6 @@ impl From<ureq::Error> for HydrusError {
#[derive(PartialEq, Debug, Clone)]
#[repr(u8)]
-
pub enum HydrusPermissions {
ImportAndEditURLs = 0,
ImportAndEditFiles,