Skip to content

Commit

Permalink
Convert 'str' to String
Browse files Browse the repository at this point in the history
  • Loading branch information
nnh12 committed Nov 25, 2024
1 parent 1fd2b54 commit 286ace5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions applications/less/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fn get_content_string(file_path: String) -> Result<String, String> {
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)
Expand Down Expand Up @@ -167,7 +167,7 @@ fn parse_content(content: &String) -> Result<BTreeMap<usize, LineSlice>, &'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<usize, LineSlice>,
fn display_content(content: &str, map: &BTreeMap<usize, LineSlice>,
line_start: usize, terminal: &Terminal)
-> Result<(), &'static str> {
// Get exclusive control of the terminal. It is locked through the whole function to
Expand Down

0 comments on commit 286ace5

Please sign in to comment.