mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 20:59:23 +00:00
Merge branch 'next' into next-polkadot-sdk
This commit is contained in:
23
patches/simple-request/Cargo.toml
Normal file
23
patches/simple-request/Cargo.toml
Normal file
@@ -0,0 +1,23 @@
|
||||
[package]
|
||||
name = "simple-request"
|
||||
version = "0.1.99"
|
||||
description = "simple-request which patches to the latest update"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/serai-dex/serai/tree/develop/patches/simple-request"
|
||||
authors = ["Luke Parker <lukeparker5132@gmail.com>"]
|
||||
keywords = ["nostd", "no_std", "alloc", "io"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
simple-request = { path = "../../common/request" }
|
||||
|
||||
[features]
|
||||
tls = ["simple-request/tls"]
|
||||
18
patches/simple-request/src/lib.rs
Normal file
18
patches/simple-request/src/lib.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
pub use simple_request::{hyper, Error, Request, Response};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Client(simple_request::Client);
|
||||
|
||||
impl Client {
|
||||
pub fn with_connection_pool() -> Client {
|
||||
Self(simple_request::Client::with_connection_pool().unwrap())
|
||||
}
|
||||
|
||||
pub fn without_connection_pool(host: &str) -> Result<Client, Error> {
|
||||
simple_request::Client::without_connection_pool(host).map(Self)
|
||||
}
|
||||
|
||||
pub async fn request<R: Into<Request>>(&self, request: R) -> Result<Response<'_>, Error> {
|
||||
self.0.request(request).await
|
||||
}
|
||||
}
|
||||
23
patches/std-shims/Cargo.toml
Normal file
23
patches/std-shims/Cargo.toml
Normal file
@@ -0,0 +1,23 @@
|
||||
[package]
|
||||
name = "std-shims"
|
||||
version = "0.1.99"
|
||||
description = "std-shims which patches to the latest update"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/serai-dex/serai/tree/develop/patches/std-shims"
|
||||
authors = ["Luke Parker <lukeparker5132@gmail.com>"]
|
||||
keywords = ["nostd", "no_std", "alloc", "io"]
|
||||
edition = "2021"
|
||||
rust-version = "1.65"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
std-shims = { path = "../../common/std-shims", default-features = false, features = ["alloc"] }
|
||||
|
||||
[features]
|
||||
std = ["std-shims/std"]
|
||||
5
patches/std-shims/src/lib.rs
Normal file
5
patches/std-shims/src/lib.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
pub extern crate alloc;
|
||||
pub use std_shims::{str, vec, string, collections, io, sync, prelude};
|
||||
Reference in New Issue
Block a user