Jelajahi Sumber

Replace &String with &str

nwin 11 tahun lalu
induk
melakukan
376e417c3f
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      src/column.rs

+ 1 - 1
src/column.rs

@@ -68,7 +68,7 @@ impl Alignment {
     /// of spaces to add: this is because the strings are usually full of
     /// invisible control characters, so getting the displayed width of the
     /// string is not as simple as just getting its length.
-    pub fn pad_string(&self, string: &String, padding: usize) -> String {
+    pub fn pad_string(&self, string: &str, padding: usize) -> String {
         match *self {
             Alignment::Left  => format!("{}{}", string, spaces(padding).as_slice()),
             Alignment::Right => format!("{}{}", spaces(padding), string.as_slice()),