mirror of
https://github.com/fluencelabs/interface-types
synced 2024-12-04 15:20:20 +00:00
Remove Default from Vec1, add into_vec
This commit is contained in:
parent
689c6757fb
commit
5517af8b97
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user