From e9ba517b8e20b8289c6f314ee8401bb4fcb30293 Mon Sep 17 00:00:00 2001 From: novacrazy Date: Wed, 20 Mar 2024 13:03:54 -0500 Subject: [PATCH] Update reqwest, cleanup json Value usage --- Cargo.toml | 15 +++++---------- src/models/party/prefs.rs | 2 -- src/models/user/prefs.rs | 2 -- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 77ab90029..8f3b16745 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,6 @@ rkyv = { version = "0.7", optional = true, features = ["validation", "smol_str", bytecheck = { version = "0.6", optional = true } serde = { version = "1", features = ["derive", "rc"] } -serde_json = "1" bitflags = "2" serde_repr = "0.1" enum-primitive-derive = "0.3" @@ -58,6 +57,8 @@ ahash = { version = "0.8", optional = true } # Maybe? # typescript-definitions = { git = "https://github.com/storyscript/typescript-definitions" } +serde_json = { version = "1", optional = true } + postgres-types = { version = "0.2.1", optional = true } bytes = { version = "1", optional = true } rusqlite = { version = "0.31.0", optional = true } @@ -77,6 +78,7 @@ percent-encoding = { version = "2.1.0", optional = true } arc-swap = { version = "1.5", optional = true } base64 = { version = "0.22.0", optional = true } tokio = { version = "1", optional = true, default_features = false, features = ["io-util"] } +reqwest = { version = "0.12", optional = true, default_features = false, features = ["gzip", "deflate", "http2"] } tokio-tungstenite = { version = "0.21", optional = true, default_features = false, features = ["connect"] } miniz_oxide = { version = "0.7", optional = true } @@ -85,13 +87,6 @@ pin-project-lite = { version = "0.2.8", optional = true } async-trait = { version = "0.1", optional = true } smallvec = { version = "1.10.0", optional = true } -[dependencies.reqwest] -git = "https://github.com/seanmonstar/reqwest" -branch = "0.12-dev" -optional = true -default_features = false -features = ["gzip", "deflate", "http2"] - [features] _internal_common = ["thiserror"] @@ -105,7 +100,7 @@ rusqlite = ["dep:rusqlite", "common/rusqlite", "timestamp/rusqlite", "snowflake/ api = ["http", "_internal_common", "percent-encoding", "futures"] # http required for Method # Low-level command execution -driver = ["reqwest", "api", "serde_urlencoded", "form_urlencoded", "headers", "mime", "url", "base64", "crc32fast", "bytes", "lazy_static"] +driver = ["serde_json", "reqwest", "api", "serde_urlencoded", "form_urlencoded", "headers", "mime", "url", "base64", "crc32fast", "bytes", "lazy_static"] # High-level client library client = ["driver", "arc-swap", "tokio"] @@ -114,7 +109,7 @@ fs = ["tokio/fs"] brotli = ["reqwest?/brotli"] # Realtime gateway support -gateway = ["tokio-tungstenite", "miniz_oxide", "futures", "pin-project-lite", "_internal_common"] +gateway = ["serde_json", "tokio-tungstenite", "miniz_oxide", "futures", "pin-project-lite", "_internal_common"] framework_utils = ["smallvec"] framework = ["client", "gateway", "async-trait", "tokio/macros", "framework_utils"] diff --git a/src/models/party/prefs.rs b/src/models/party/prefs.rs index b4fb092d9..d56d26593 100644 --- a/src/models/party/prefs.rs +++ b/src/models/party/prefs.rs @@ -1,8 +1,6 @@ use std::collections::HashMap; use std::fmt; -use serde_json::Value; - use super::*; use crate::models::Locale; diff --git a/src/models/user/prefs.rs b/src/models/user/prefs.rs index e3a6c4e64..006f4b362 100644 --- a/src/models/user/prefs.rs +++ b/src/models/user/prefs.rs @@ -1,8 +1,6 @@ use std::collections::HashMap; use std::fmt; -use serde_json::Value; - use super::*; common::enum_codes! {