Fix lints

This commit is contained in:
Andras Schmelczer 2025-10-26 21:29:52 +00:00
parent 3da0673af6
commit 450eaaff05
5 changed files with 29 additions and 16 deletions

View file

@ -1,4 +1,4 @@
use std::iter::Iterator;
use std::{fmt, iter::Iterator};
/// A helper for building a string in-order based on an original string and a
/// series of insertions, deletions, and copies applied to it. It is safe to use
@ -12,6 +12,18 @@ pub struct StringBuilder<'a> {
remaining: String,
}
impl fmt::Debug for StringBuilder<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut debug_struct = f.debug_struct("StringBuilder");
debug_struct.field("buffer", &self.buffer);
#[cfg(debug_assertions)]
debug_struct.field("remaining", &self.remaining);
debug_struct.finish_non_exhaustive()
}
}
impl StringBuilder<'_> {
pub fn new(original: &str) -> StringBuilder<'_> {
StringBuilder {