Skip to content

Commit

Permalink
Implement Display instead of ToString
Browse files Browse the repository at this point in the history
This fixes the warning from clippy

for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl
  • Loading branch information
OMGeeky committed May 16, 2024
1 parent ce47a46 commit 70e5c03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions google-clis-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ use std::io;
use std::io::{stdout, Write};
use std::path::Path;
use std::str::FromStr;
use std::string::ToString;

use std::default::Default;
use std::fmt::Display;

const FIELD_SEP: char = '.';

Expand Down Expand Up @@ -125,9 +125,9 @@ impl AsRef<str> for CallType {
#[derive(Clone, Default)]
pub struct FieldCursor(Vec<String>);

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

Expand Down

0 comments on commit 70e5c03

Please sign in to comment.