@@ -3,8 +3,8 @@ use anyhow::{bail, Result};
33pub trait VersionedData < ' a > : Sized {
44 type Latest ;
55
6- fn latest ( latest : Self :: Latest ) -> Self ;
7- fn into_latest ( self ) -> Result < Self :: Latest > ;
6+ fn wrap_latest ( latest : Self :: Latest ) -> Self ;
7+ fn unwrap_latest ( self ) -> Result < Self :: Latest > ;
88 fn deserialize_version ( payload : & ' a [ u8 ] , version : u16 ) -> Result < Self > ;
99 fn serialize_version ( self , version : u16 ) -> Result < Vec < u8 > > ;
1010
@@ -36,7 +36,7 @@ pub trait VersionedData<'a>: Sized {
3636 data = converter ( data) ?;
3737 }
3838
39- data. into_latest ( )
39+ data. unwrap_latest ( )
4040 }
4141
4242 fn serialize ( self , version : u16 ) -> Result < Vec < u8 > > {
@@ -77,8 +77,8 @@ pub trait VersionedData<'a>: Sized {
7777pub trait OwnedVersionedData : Sized {
7878 type Latest ;
7979
80- fn latest ( latest : Self :: Latest ) -> Self ;
81- fn into_latest ( self ) -> Result < Self :: Latest > ;
80+ fn wrap_latest ( latest : Self :: Latest ) -> Self ;
81+ fn unwrap_latest ( self ) -> Result < Self :: Latest > ;
8282 fn deserialize_version ( payload : & [ u8 ] , version : u16 ) -> Result < Self > ;
8383 fn serialize_version ( self , version : u16 ) -> Result < Vec < u8 > > ;
8484
@@ -110,7 +110,7 @@ pub trait OwnedVersionedData: Sized {
110110 data = converter ( data) ?;
111111 }
112112
113- data. into_latest ( )
113+ data. unwrap_latest ( )
114114 }
115115
116116 fn serialize ( self , version : u16 ) -> Result < Vec < u8 > > {
0 commit comments