finished client refactor, client2 -> client

This commit is contained in:
ThetaDev 2022-09-15 17:26:00 +02:00
parent 05f609e247
commit 8548bc81e9
39 changed files with 1484 additions and 11468 deletions

View file

@ -5,3 +5,32 @@ mod vec_log_err;
pub use range::Range;
pub use vec_log_err::VecLogError;
use std::fmt::Debug;
#[derive(Clone)]
pub struct MapResult<T> {
pub c: T,
pub warnings: Vec<String>,
}
impl<T> Debug for MapResult<T>
where
T: Debug,
{
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.c.fmt(f)
}
}
impl<T> Default for MapResult<T>
where
T: Default,
{
fn default() -> Self {
Self {
c: Default::default(),
warnings: Vec::new(),
}
}
}

View file

@ -6,7 +6,7 @@ use serde::{
};
use serde_with::{de::DeserializeAsWrap, DeserializeAs};
use crate::client2::MapResult;
use super::MapResult;
pub struct VecLogError<T>(PhantomData<T>);
@ -89,7 +89,7 @@ mod tests {
use serde::Deserialize;
use serde_with::serde_as;
use crate::client2::MapResult;
use crate::serializer::MapResult;
#[serde_as]
#[derive(Debug, Deserialize)]