Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy committed Dec 8, 2024
1 parent cf97689 commit cd852ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use bytes::Bytes;
use std::fmt::Display;

use flowy_error::{internal_error, FlowyResult};

Expand Down Expand Up @@ -64,15 +65,10 @@ impl CellProtobufBlob {
// }
}

impl ToString for CellProtobufBlob {
fn to_string(&self) -> String {
match String::from_utf8(self.0.to_vec()) {
Ok(s) => s,
Err(e) => {
tracing::error!("DecodedCellData to string failed: {:?}", e);
"".to_string()
},
}
impl Display for CellProtobufBlob {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let s = String::from_utf8(self.0.to_vec()).unwrap_or_default();
write!(f, "{}", s)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use bytes::Bytes;
use protobuf::ProtobufError;
use std::fmt::Display;

#[derive(Default, Debug, Clone)]
pub struct ProtobufStr(pub String);
Expand All @@ -23,9 +24,9 @@ impl std::convert::From<String> for ProtobufStr {
}
}

impl ToString for ProtobufStr {
fn to_string(&self) -> String {
self.0.clone()
impl Display for ProtobufStr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0.clone())
}
}

Expand Down

0 comments on commit cd852ce

Please sign in to comment.