committed by
Michael Vines
parent
89caf65966
commit
edf5bc242c
@ -189,7 +189,7 @@ impl<'a> AccountInfo<'a> {
|
|||||||
bincode::deserialize(&self.data.borrow())
|
bincode::deserialize(&self.data.borrow())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn serialize_data<T: serde::Serialize>(&mut self, state: &T) -> Result<(), bincode::Error> {
|
pub fn serialize_data<T: serde::Serialize>(&self, state: &T) -> Result<(), bincode::Error> {
|
||||||
if bincode::serialized_size(state)? > self.data_len() as u64 {
|
if bincode::serialized_size(state)? > self.data_len() as u64 {
|
||||||
return Err(Box::new(bincode::ErrorKind::SizeLimit));
|
return Err(Box::new(bincode::ErrorKind::SizeLimit));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user