From 195d5f077020a0c00e276acb81e533bbef246a79 Mon Sep 17 00:00:00 2001 From: Sijmen Schoon Date: Mon, 28 Oct 2019 01:44:35 +0100 Subject: [PATCH] Rename s to string in truncate --- src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 984844f..06ff4eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,13 +8,13 @@ use std::fs::OpenOptions; use std::io::Read; use std::path::PathBuf; -fn truncate(s: String, size: usize) -> String { - if s.len() > size { - let mut s = s; - s.truncate(size - 3); - format!("{}...", s) +fn truncate(string: String, size: usize) -> String { + if string.len() > size { + let mut string = string; + string.truncate(size - 3); + format!("{}...", string) } else { - s + string } }