From 5370e51d2221c2b92836b76fc32afd791df781d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Tue, 24 Sep 2024 12:55:42 +0000 Subject: [PATCH] fix impl Display regression messed up merging #154 a tad too early, CI UI was acting up --- src/sql/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sql/mod.rs b/src/sql/mod.rs index c2f8803..7417be7 100644 --- a/src/sql/mod.rs +++ b/src/sql/mod.rs @@ -1,4 +1,4 @@ -use std::fmt::{self, Display}; +use std::fmt::{self, Display, Write}; use crate::{ error::{Error, Result}, @@ -32,13 +32,14 @@ impl fmt::Display for SqlBuilder { SqlBuilder::InProgress(parts) => { for part in parts { match part { - Part::Arg => write!(f, "?")?, - Part::Fields => write!(f, "?fields")?, - Part::Text(text) => write!(f, "{text}")?, + Part::Arg => f.write_char('?')?, + Part::Fields => f.write_str("?fields")?, + Part::Str(text) => f.write_str(text)?, + Part::Text(text) => f.write_str(text)?, } } } - SqlBuilder::Failed(err) => write!(f, "{err}")?, + SqlBuilder::Failed(err) => f.write_str(err)?, } Ok(()) }