serwus 0.2.3

Helpers for building actix-web/diesel based services
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// Depreacted, use [SanitizedString](crate::utils::SanitizedString)
#[deprecated]
pub trait Sanitize {
    fn sanitize(&mut self);
}

/// Depreacted, use [SanitizedString](crate::utils::SanitizedString)
#[deprecated]
#[macro_export]
macro_rules! sanitizable {
    ($model:ident, $( $field:ident ),* ) => {
        impl $crate::Sanitize for $model {
            fn sanitize(&mut self) {
                $(self.$field = self.$field.trim().to_string();)*
            }
        }
    };
}