Move result structures to a more appropriate location
This commit is contained in:
@ -1,13 +1,4 @@
|
||||
use std::error::Error;
|
||||
use std::fmt::Display;
|
||||
use std::io::ErrorKind;
|
||||
|
||||
pub mod network_utils;
|
||||
pub mod res_utils;
|
||||
pub mod string_utils;
|
||||
pub mod time_utils;
|
||||
|
||||
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()))
|
||||
}
|
||||
|
9
rust/sea_battle_backend/src/utils/res_utils.rs
Normal file
9
rust/sea_battle_backend/src/utils/res_utils.rs
Normal file
@ -0,0 +1,9 @@
|
||||
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()))
|
||||
}
|
Reference in New Issue
Block a user