From 70e5c03a670513dc48206791d8de0047e69b0acd Mon Sep 17 00:00:00 2001 From: OMGeeky Date: Thu, 16 May 2024 20:46:06 +0200 Subject: [PATCH] Implement Display instead of ToString This fixes the warning from clippy for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl --- google-clis-common/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/google-clis-common/src/lib.rs b/google-clis-common/src/lib.rs index 36ebec625a..82dc9f16c9 100644 --- a/google-clis-common/src/lib.rs +++ b/google-clis-common/src/lib.rs @@ -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 = '.'; @@ -125,9 +125,9 @@ impl AsRef for CallType { #[derive(Clone, Default)] pub struct FieldCursor(Vec); -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(".")) } }