Merge branch 'master' into byte_array

This commit is contained in:
folex 2020-07-20 15:45:06 +03:00
commit 4521e79a50

View File

@ -9,7 +9,7 @@ use serde::{Serialize, Deserialize};
/// `Vec1<T>` represents a non-empty `Vec<T>`. It derefs to `Vec<T>`
/// directly.
#[derive(Clone, PartialEq, Serialize, Deserialize, Default)]
#[derive(Clone, PartialEq, Serialize, Deserialize)]
pub struct Vec1<T>(Vec<T>)
where
T: Debug;
@ -40,6 +40,11 @@ where
Ok(Self(items))
}
}
/// Converts this Vec1 into Vec
pub fn into_vec(self) -> Vec<T> {
self.0
}
}
impl<T> fmt::Debug for Vec1<T>