From 98f1b2bc4a0cebda5dbef37865b533f97c1156b0 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 15 Jul 2024 14:32:58 +1000 Subject: [PATCH] fix for mrsv change --- .cargo/config.toml | 6 ++++++ cmd/soroban-cli/src/toid.rs | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 02f193482..bf55a5d40 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -26,6 +26,12 @@ rustflags = [ "-Aclippy::must_use_candidate", "-Aclippy::missing_panics_doc", "-Aclippy::missing_errors_doc", + + # Disable doc-markdown because it asks for backticks to be added around text + # that shouldn't be surrounded by backticks. + # https://github.com/rust-lang/rust-clippy/issues/13097 + "-A clippy::doc-markdown", + # "-Aclippy::missing_safety_doc", # "-Aclippy::inline_always", # "-Aclippy::default_trait_access", diff --git a/cmd/soroban-cli/src/toid.rs b/cmd/soroban-cli/src/toid.rs index 55c890490..f5a13a32b 100644 --- a/cmd/soroban-cli/src/toid.rs +++ b/cmd/soroban-cli/src/toid.rs @@ -1,3 +1,5 @@ +use std::fmt::Display; + /// A barebones implementation of Total Order IDs (TOIDs) from /// [SEP-35](https://stellar.org/protocol/sep-35), using the reference /// implementation from the Go @@ -61,9 +63,9 @@ impl From for u64 { } } -impl ToString for Toid { - fn to_string(&self) -> String { +impl Display for Toid { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let u: u64 = (*self).into(); - u.to_string() + write!(f, "{u}") } }