INNER CODE UNIT · Rust
internal
zly2006/zhihu-plus-plus · aigc-vote-server/src/lib.rs:223
fn internal(message: impl Into<String>) -> Self {
Self {
status: StatusCode::INTERNAL_SERVER_ERROR,
message: message.into(),
}
}
}
impl From<sqlx::Error> for ServiceError {
fn from(value: sqlx::Error) -> Self {
Self::internal(value.to_string())
}
}
impl IntoResponse for ServiceError {
fn into_response(self) -> Response {
(
self.status,