Skip to content

Commit

Permalink
map_or main.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-ha458 committed Sep 16, 2023
1 parent 879ae51 commit c5a8880
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions binaries/llm-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,7 @@ fn info(args: &cli_args::Info) -> eyre::Result<()> {
}

fn utf8_or_array(token: &[u8]) -> String {
std::str::from_utf8(token)
.map(|s| s.to_owned())
.unwrap_or(format!("{:?}", token))
std::str::from_utf8(token).map_or(format!("{:?}", token), |s| s.to_owned())
}

Ok(())
Expand Down

0 comments on commit c5a8880

Please sign in to comment.