Amend es sagt mir Map ist save, map ist nicht save :(
This commit is contained in:
parent
3e119877b1
commit
1e13e8d07e
2 changed files with 5 additions and 2 deletions
|
|
@ -27,7 +27,11 @@ pub async fn handle(
|
|||
}
|
||||
|
||||
let path_parts: Vec<&str> = path.split("/").collect();
|
||||
let body: Option<JsonValue> = body_string.map(|s| json::parse(&s).unwrap());
|
||||
let body: Option<JsonValue> = if body_string.is_some() {
|
||||
body_string.map(|s| json::parse(&s).unwrap())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let (status, content, body_text) = if path_parts.len() >= 3 {
|
||||
match path_parts[2] {
|
||||
"app_state" => (StatusCode::OK, "application/json", {
|
||||
|
|
|
|||
Loading…
Reference in a new issue