Rename s to string in truncate
This commit is contained in:
parent
e05823a4d9
commit
195d5f0770
12
src/main.rs
12
src/main.rs
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue