Add new test for client configuration

This commit is contained in:
2022-09-02 10:42:22 +02:00
parent 6f8055f1c7
commit 019ae92605
6 changed files with 66 additions and 21 deletions

View File

@ -2,8 +2,8 @@ use std::fmt::Display;
use std::io::ErrorKind;
/// Encapsulate errors in [`std::io::Error`] with a message
pub fn encpasulate_error<E: Display>(e: E, msg: &str) -> std::io::Error {
std::io::Error::new(ErrorKind::Other, format!("{}: {}", msg, e))
pub fn encpasulate_error<E: Display, F: ToString>(e: E, msg: F) -> std::io::Error {
std::io::Error::new(ErrorKind::Other, format!("{}: {}", msg.to_string(), e))
}
/// Create a new [`std::io::Error`]