as json fix
This commit is contained in:
parent
e281a87258
commit
6d3d1d1cbd
@ -56,7 +56,7 @@ impl HttpServer for EzSite {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn on_start(&self, host: &str) {
|
async fn on_start(&self, host: &str) {
|
||||||
println!("Http server started on {}", host);
|
println!("Http server started on {host}");
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn on_close(&self) {
|
async fn on_close(&self) {
|
||||||
|
@ -39,7 +39,7 @@ impl Body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn as_json(&self) -> Option<Value> {
|
pub fn as_json(&self) -> Option<Value> {
|
||||||
serde_json::to_value(self.as_text()?).ok()
|
serde_json::from_str(&self.as_text()?).ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_bytes(bytes: &[u8]) -> Body {
|
pub fn from_bytes(bytes: &[u8]) -> Body {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user