Skip to content

Commit

Permalink
perf: Add ToString trait for proxy exec result.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Oct 27, 2023
1 parent a1693cf commit 9bac6e9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/database/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ impl Into<u64> for ProxyExecResultIdType {
}
}

impl Into<String> for ProxyExecResultIdType {
fn into(self) -> String {
self.to_string()
}
}

impl ToString for ProxyExecResultIdType {
fn to_string(&self) -> String {
match self {
Self::Integer(val) => val.to_string(),
Self::String(val) => val.to_owned(),
Self::Bytes(val) => String::from_utf8_lossy(&val).to_string(),
Self::Uuid(val) => val.to_string(),
}
}
}

/// Defines the results obtained from a [ProxyDatabase]
#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)]
pub enum ProxyExecResult {
Expand Down

0 comments on commit 9bac6e9

Please sign in to comment.