Browse Source

Make rc2 factory API Send-able

master
NGnius (Graham) 1 year ago
parent
commit
5f6dedebac
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      Cargo.toml
  2. +2
    -2
      src/robocraft2/factory.rs

+ 2
- 2
Cargo.toml View File

@@ -1,6 +1,6 @@
[package]
name = "libfj"
version = "0.7.0"
version = "0.7.1"
authors = ["NGnius (Graham) <ngniusness@gmail.com>"]
edition = "2018"
description = "An unofficial collection of APIs used in FreeJam games and mods"
@@ -18,7 +18,7 @@ exclude = [
[dependencies]
serde = { version = "^1", features = ["derive"]}
serde_json = "^1"
reqwest = { version = "^0.11", features = ["json"], optional = true}
reqwest = { version = "^0.11", features = ["json", "rustls-tls"], optional = true, default-features=false}
url = "^2.2"
ureq = { version = "^2", features = ["json"], optional = true}
async-trait = { version = "0.1", optional = true }


+ 2
- 2
src/robocraft2/factory.rs View File

@@ -47,7 +47,7 @@ async fn handle_json_response<D: for<'a> serde::Deserialize<'a>>(response: Respo
/// CRF API implementation
pub struct FactoryAPI {
client: Client,
token: Mutex<Box<dyn ITokenProvider>>,
token: Mutex<Box<dyn ITokenProvider + Send>>,
}

impl FactoryAPI {
@@ -60,7 +60,7 @@ impl FactoryAPI {
}*/

/// Create a new instance using the provided token provider.
pub fn with_auth(token_provider: Box<dyn ITokenProvider>) -> FactoryAPI {
pub fn with_auth(token_provider: Box<dyn ITokenProvider + Send>) -> FactoryAPI {
FactoryAPI {
client: Client::new(),
token: Mutex::new(token_provider),


Loading…
Cancel
Save