INNER CODE UNIT · Rust

from_io

TheWaWaR/simple-http-server · src/handlers.rs:107

    fn from_io(err: io::Error) -> Self {
        let status = match err.kind() {
            io::ErrorKind::PermissionDenied => StatusCode::FORBIDDEN,
            io::ErrorKind::NotFound => StatusCode::NOT_FOUND,
            _ => StatusCode::INTERNAL_SERVER_ERROR,
        };
        Self::new(status, err.to_string())
    }
}

impl EntityTag {
    fn strong_eq(&self, other: &Self) -> bool {
        !self.weak && !other.weak && self.tag == other.tag
    }

    fn weak_eq(&self, other: &Self) -> bool {
        self.tag == other.tag
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…