Skip to content

Commit

Permalink
replaced to_string calls with write macros
Browse files Browse the repository at this point in the history
  • Loading branch information
Walnut356 committed Oct 6, 2023
1 parent 06ba348 commit 81f39cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/polars-core/src/fmt.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(any(feature = "fmt", feature = "fmt_no_tty"))]
use std::borrow::Cow;
use std::fmt::{Debug, Display, Formatter};
use std::fmt::{Debug, Display, Formatter, Write};
use std::sync::atomic::{AtomicU8, Ordering};
use std::{fmt, str};

Expand Down Expand Up @@ -959,15 +959,15 @@ impl Series {
let mut result = "[".to_owned();

for (i, item) in self.iter().enumerate() {
result.push_str(&item.to_string());
write!(result, "{item}").unwrap();

if i != self.len() - 1 {
result.push_str(", ");
}

if i == max_items - 2 {
result.push_str("… ");
result.push_str(&self.get(self.len() - 1).unwrap().to_string());
write!(result, "{}", self.get(self.len() - 1).unwrap()).unwrap();
break;
}
}
Expand Down

0 comments on commit 81f39cd

Please sign in to comment.