Rename s to string in truncate

This commit is contained in:
Sijmen 2019-10-28 01:44:35 +01:00
parent e05823a4d9
commit 195d5f0770

View file

@ -8,13 +8,13 @@ use std::fs::OpenOptions;
use std::io::Read; use std::io::Read;
use std::path::PathBuf; use std::path::PathBuf;
fn truncate(s: String, size: usize) -> String { fn truncate(string: String, size: usize) -> String {
if s.len() > size { if string.len() > size {
let mut s = s; let mut string = string;
s.truncate(size - 3); string.truncate(size - 3);
format!("{}...", s) format!("{}...", string)
} else { } else {
s string
} }
} }