Added MultipartFile extractors.
Moved cfg macro to lib where possible. Changed some features, and made some deps optional
This commit is contained in:
@ -1,9 +1,7 @@
|
||||
#[cfg(feature = "vec")]
|
||||
pub trait Distinct {
|
||||
fn distinct(&mut self);
|
||||
}
|
||||
|
||||
#[cfg(feature = "vec")]
|
||||
impl<T: PartialEq + Clone> Distinct for Vec<T> {
|
||||
fn distinct(&mut self) {
|
||||
*self = self.iter().fold(vec![], |mut acc, x| {
|
||||
@ -15,7 +13,7 @@ impl<T: PartialEq + Clone> Distinct for Vec<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(test, feature = "vec"))]
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#[macro_export]
|
||||
#[cfg(feature = "vec")]
|
||||
macro_rules! map {
|
||||
() => { std::collections::HashMap::new() };
|
||||
($($k:expr => $v:expr),* $(,)?) => {
|
||||
@ -13,7 +12,7 @@ macro_rules! map {
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(all(test, feature = "vec"))]
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::collections::HashMap;
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
#[macro_export]
|
||||
#[cfg(feature = "vec")]
|
||||
macro_rules! matrix {
|
||||
($x:expr; $m:expr, $n:expr) => {
|
||||
vec![vec![$x; $n]; $m]
|
||||
@ -16,7 +15,7 @@ macro_rules! matrix {
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(all(test, feature = "vec"))]
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
#[test]
|
||||
|
@ -1,5 +1,4 @@
|
||||
#[macro_export]
|
||||
#[cfg(feature = "vec")]
|
||||
macro_rules! set {
|
||||
() => { std::collections::HashSet::new() };
|
||||
($($x:expr),* $(,)?) => {
|
||||
@ -13,7 +12,7 @@ macro_rules! set {
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(all(test, feature = "vec"))]
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::collections::HashSet;
|
||||
|
||||
|
Reference in New Issue
Block a user