MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / delete_question

Function delete_question

ch_04/final/src/main.rs:176–181  ·  view source on GitHub ↗
(id: String, store: Store)

Source from the content-addressed store, hash-verified

174}
175
176async fn delete_question(id: String, store: Store) -> Result<impl warp::Reply, warp::Rejection> {
177 match store.questions.write().await.remove(&QuestionId(id)) {
178 Some(_) => return Ok(warp::reply::with_status("Question deleted", StatusCode::OK)),
179 None => return Err(warp::reject::custom(Error::QuestionNotFound)),
180 }
181}
182
183async fn add_answer(
184 store: Store,

Callers

nothing calls this directly

Calls 1

QuestionIdClass · 0.70

Tested by

no test coverage detected