diff --git a/martin-tile-utils/src/lib.rs b/martin-tile-utils/src/lib.rs index 9df4fd498..43b7705a1 100644 --- a/martin-tile-utils/src/lib.rs +++ b/martin-tile-utils/src/lib.rs @@ -75,14 +75,14 @@ impl Format { impl Display for Format { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match *self { - Self::Gif => write!(f, "gif"), - Self::Jpeg => write!(f, "jpeg"), - Self::Json => write!(f, "json"), - Self::Mvt => write!(f, "mvt"), - Self::Png => write!(f, "png"), - Self::Webp => write!(f, "webp"), - } + f.write_str(match *self { + Self::Gif => "gif", + Self::Jpeg => "jpeg", + Self::Json => "json", + Self::Mvt => "mvt", + Self::Png => "png", + Self::Webp => "webp", + }) } } @@ -194,7 +194,7 @@ impl Display for TileInfo { if let Some(encoding) = self.encoding.content_encoding() { write!(f, "; encoding={encoding}")?; } else if self.encoding != Encoding::Uncompressed { - write!(f, "; uncompressed")?; + f.write_str("; uncompressed")?; } Ok(()) } diff --git a/martin/src/bin/martin-cp.rs b/martin/src/bin/martin-cp.rs index d24031ea9..35c75d6ce 100644 --- a/martin/src/bin/martin-cp.rs +++ b/martin/src/bin/martin-cp.rs @@ -253,9 +253,9 @@ impl Display for Progress { let left = self.total - done; if left == 0 { - write!(f, " | done") + f.write_str(" | done") } else if done == 0 { - write!(f, " | ??? left") + f.write_str(" | ??? left") } else { let left = Duration::from_secs_f32(elapsed_s * left as f32 / done as f32); write!(f, " | {left:.0?} left") diff --git a/martin/src/pg/query_functions.rs b/martin/src/pg/query_functions.rs index f1ec01a99..898cbdf09 100644 --- a/martin/src/pg/query_functions.rs +++ b/martin/src/pg/query_functions.rs @@ -70,13 +70,13 @@ pub async fn query_available_function(pool: &PgPool) -> PgResult 0 { - write!(query, ", ").unwrap(); + query.push_str(", "); } // This could also be done as "{name} => ${index}::{typ}" // where the name must be passed through escape_identifier write!(query, "${index}::{typ}", index = idx + 1).unwrap(); } - write!(query, ")").unwrap(); + query.push(')'); // TODO: Rewrite as a if-let chain: if Some(names) = output_record_names && output_type == "record" { ... } let ret_inf = if let (Some(names), "record") = (output_record_names, output_type.as_str()) {