Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Compact<T>(T);
- impl<T> From<T> for Compact<T> {
- fn from(t: T) -> Self {
- Compact(t)
- }
- }
- impl<T> Into<T> for Compact<T> {
- fn into(self) -> T {
- self.0
- }
- }
- impl<T> From<Compact<T>> for T {
- fn from(c: Compact<T>) -> Self {
- c.0
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement