Skip to content

Commit 9734ad2

Browse files
David Tolnaymeta-codesync[bot]
authored andcommitted
treestate: Allow serializing dynamically sized value
Summary: Used in {D99974194} to implement serialize for `[u8]`. Reviewed By: diliop Differential Revision: D100345293 fbshipit-source-id: 4b96ef48e65f2aa0c45c5f394efa9304edfe9ffb
1 parent e499fa6 commit 9734ad2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

eden/scm/lib/treestate/src/serialization.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,14 @@ use crate::tree::Node;
4242
use crate::tree::NodeEntry;
4343
use crate::tree::NodeEntryMap;
4444

45-
pub trait Serializable
46-
where
47-
Self: Sized,
48-
{
45+
pub trait Serializable {
4946
/// Serialize the storable data to a `Write` stream.
5047
fn serialize(&self, w: &mut dyn Write) -> Result<()>;
5148

5249
/// Deserialize a new data item from a `Read` stream.
53-
fn deserialize(r: &mut dyn Read) -> Result<Self>;
50+
fn deserialize(r: &mut dyn Read) -> Result<Self>
51+
where
52+
Self: Sized;
5453
}
5554

5655
impl Serializable for FileState {

0 commit comments

Comments
 (0)