This repository has been archived on 2025-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
Files
SeaBattle/rust/sea_battle_backend/src/utils/res_utils.rs

10 lines
252 B
Rust

use std::error::Error;
use std::fmt::Display;
use std::io::ErrorKind;
pub type Res<E = ()> = Result<E, Box<dyn Error>>;
pub fn boxed_error<D: Display>(msg: D) -> Box<dyn Error> {
Box::new(std::io::Error::new(ErrorKind::Other, msg.to_string()))
}