Amend es sagt mir Map ist save, map ist nicht save :(

This commit is contained in:
Alex Emmet 2025-11-22 21:25:09 +00:00
commit 1e13e8d07e
2 changed files with 5 additions and 2 deletions

View file

@ -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", {