From 286ace506fb2d0852b29f4e34e7b5fe6cd08b666 Mon Sep 17 00:00:00 2001 From: Nathan Hsiao Date: Sun, 24 Nov 2024 22:38:27 -0600 Subject: [PATCH] Convert 'str' to String --- applications/less/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/less/src/lib.rs b/applications/less/src/lib.rs index f67b022f0..363a3376a 100644 --- a/applications/less/src/lib.rs +++ b/applications/less/src/lib.rs @@ -108,7 +108,7 @@ fn get_content_string(file_path: String) -> Result { None => { // Handle the case where the path wasn't found // // For example, you could return an error or print a message: - Err(format!("Couldn't find file at path")) + Err(format!("Couldn't find file at path".to_string())) } //_ => { //println!("Couldn't find file at path {}", path) @@ -167,7 +167,7 @@ fn parse_content(content: &String) -> Result, &'stati // /// Display part of the file (may be whole file if the file is short) to the terminal, starting // /// at line number `line_start`. -fn display_content(content: &String, map: &BTreeMap, +fn display_content(content: &str, map: &BTreeMap, line_start: usize, terminal: &Terminal) -> Result<(), &'static str> { // Get exclusive control of the terminal. It is locked through the whole function to