) .into_response(), } } } pub(super) trait OptionExt { fn ok_or_not_found S, S: Into>(self, f: F) -> ServerResult; } impl OptionExt for Option { fn ok_or_not_found S, S: Into>(self, f: F) -> ServerResult { match self { Some(value) => Ok(value), None => Err(ServerError::NotFound(f().into() + " not found")), } } } impl From for ServerError { fn from(error: Error) -> Self { Self::Internal(error) } }