Skip to content

Commit

Permalink
Use Display iml instead of ToString
Browse files Browse the repository at this point in the history
  • Loading branch information
dani-garcia committed May 10, 2024
1 parent 2f52f5e commit 5da1339
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions crates/bitwarden-exporters/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mod json;
use json::export_json;
mod encrypted_json;
use encrypted_json::export_encrypted_json;
use std::fmt;

pub enum Format {
Csv,
Expand Down Expand Up @@ -63,13 +64,13 @@ pub enum CipherType {
Identity(Box<Identity>),
}

impl ToString for CipherType {
fn to_string(&self) -> String {
impl fmt::Display for CipherType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
CipherType::Login(_) => "login".to_string(),
CipherType::SecureNote(_) => "note".to_string(),
CipherType::Card(_) => "card".to_string(),
CipherType::Identity(_) => "identity".to_string(),
CipherType::Login(_) => write!(f, "login"),
CipherType::SecureNote(_) => write!(f, "note"),
CipherType::Card(_) => write!(f, "card"),
CipherType::Identity(_) => write!(f, "identity"),

Check warning on line 73 in crates/bitwarden-exporters/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-exporters/src/lib.rs#L71-L73

Added lines #L71 - L73 were not covered by tests
}
}
}
Expand Down

0 comments on commit 5da1339

Please sign in to comment.