fix(apb): forgot to check inside feature flag
This commit is contained in:
parent
96ff359d11
commit
270908b38c
3 changed files with 12 additions and 10 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -140,7 +140,7 @@ checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "apb"
|
name = "apb"
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"paste",
|
"paste",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "apb"
|
name = "apb"
|
||||||
version = "0.3.0"
|
version = "0.3.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = [ "alemi <me@alemi.dev>" ]
|
authors = [ "alemi <me@alemi.dev>" ]
|
||||||
description = "Traits and types to handle ActivityPub objects"
|
description = "Traits and types to handle ActivityPub objects"
|
||||||
|
|
|
@ -208,14 +208,16 @@ impl Node<serde_json::Value> {
|
||||||
#[cfg(feature = "fetch")]
|
#[cfg(feature = "fetch")]
|
||||||
pub async fn fetch(&mut self) -> reqwest::Result<&mut Self> {
|
pub async fn fetch(&mut self) -> reqwest::Result<&mut Self> {
|
||||||
if let Node::Link(link) = self {
|
if let Node::Link(link) = self {
|
||||||
*self = reqwest::Client::new()
|
if let Ok(url) = link.href() {
|
||||||
.get(link.href())
|
*self = reqwest::Client::new()
|
||||||
.header("Accept", "application/json")
|
.get(url)
|
||||||
.send()
|
.header("Accept", "application/json")
|
||||||
.await?
|
.send()
|
||||||
.json::<serde_json::Value>()
|
.await?
|
||||||
.await?
|
.json::<serde_json::Value>()
|
||||||
.into();
|
.await?
|
||||||
|
.into();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok(self)
|
Ok(self)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue