chore: impl view data processor

This commit is contained in:
appflowy
2022-03-05 22:30:42 +08:00
parent 5c155a07bf
commit 1b80934899
32 changed files with 257 additions and 145 deletions

View File

@ -521,7 +521,7 @@ impl<T> Delta<T>
where
T: Attributes + serde::Serialize,
{
pub fn to_delta_json(&self) -> String {
pub fn to_delta_str(&self) -> String {
serde_json::to_string(self).unwrap_or_else(|_| "".to_owned())
}
@ -530,7 +530,7 @@ where
}
pub fn to_bytes(&self) -> Bytes {
let json = self.to_delta_json();
let json = self.to_delta_str();
Bytes::from(json.into_bytes())
}
}