expose request in builder
This commit is contained in:
parent
7cfb715e0c
commit
01bbe37876
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "torn-api"
|
||||
version = "0.6.6"
|
||||
version = "0.6.7"
|
||||
edition = "2021"
|
||||
rust-version = "1.75.0"
|
||||
authors = ["Pyrit [2111649]"]
|
||||
|
|
|
@ -15,7 +15,7 @@ pub fn user_benchmark(c: &mut Criterion) {
|
|||
client
|
||||
.torn_api(key)
|
||||
.user(|b| {
|
||||
b.selections(&[
|
||||
b.selections([
|
||||
user::Selection::Basic,
|
||||
user::Selection::Discord,
|
||||
user::Selection::Profile,
|
||||
|
@ -49,7 +49,7 @@ pub fn faction_benchmark(c: &mut Criterion) {
|
|||
|
||||
client
|
||||
.torn_api(key)
|
||||
.faction(|b| b.selections(&[faction::Selection::Basic]))
|
||||
.faction(|b| b.selections([faction::Selection::Basic]))
|
||||
.await
|
||||
.unwrap()
|
||||
});
|
||||
|
@ -74,7 +74,7 @@ pub fn attacks_full(c: &mut Criterion) {
|
|||
|
||||
client
|
||||
.torn_api(key)
|
||||
.faction(|b| b.selections(&[faction::Selection::AttacksFull]))
|
||||
.faction(|b| b.selections([faction::Selection::AttacksFull]))
|
||||
.await
|
||||
.unwrap()
|
||||
});
|
||||
|
|
|
@ -39,9 +39,7 @@ where
|
|||
if i == 0 {
|
||||
Ok(None)
|
||||
} else {
|
||||
let naive = NaiveDateTime::from_timestamp_opt(i, 0)
|
||||
.ok_or_else(|| D::Error::invalid_value(Unexpected::Signed(i), &"Epoch timestamp"))?;
|
||||
Ok(Some(DateTime::from_utc(naive, Utc)))
|
||||
Ok(DateTime::from_timestamp(i, 0))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -223,8 +223,8 @@ pub struct ApiRequestBuilder<A>
|
|||
where
|
||||
A: ApiSelection,
|
||||
{
|
||||
request: ApiRequest<A>,
|
||||
id: Option<String>,
|
||||
pub request: ApiRequest<A>,
|
||||
pub id: Option<String>,
|
||||
}
|
||||
|
||||
impl<A> Default for ApiRequestBuilder<A>
|
||||
|
|
Loading…
Reference in a new issue