14 lines
316 B
Rust
14 lines
316 B
Rust
|
|
use std::fmt;
|
||
|
|
|
||
|
|
use crate::db::UserRef;
|
||
|
|
|
||
|
|
#[derive(Debug)]
|
||
|
|
pub struct UserAlreadyExists(pub UserRef);
|
||
|
|
|
||
|
|
impl fmt::Display for UserAlreadyExists {
|
||
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||
|
|
write!(f, "User already exists: {}", self.0)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
impl std::error::Error for UserAlreadyExists {}
|