Skip to content

Commit

Permalink
Fix string lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jerel committed Aug 22, 2023
1 parent f3f488a commit e2a18c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions membrane/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ pub(crate) fn display_code_location(location: Option<&Vec<SourceCodeLocation>>)
.map(|(index, path)| {
if last == 0 {
// single item
format!("{}", path)
path.to_string()
} else if index == 0 && last == 1 {
// on the first of two
format!("{} and", path)
} else if index == 1 && last == 1 {
// on the second of two
format!("{}", path)
path.to_string()
} else if index == (last - 1) {
// on the next to last of many
format!("{}, and", path)
} else if index == last {
// on the last of many
format!("{}", path)
path.to_string()
} else {
format!("{},", path)
}
Expand Down

0 comments on commit e2a18c1

Please sign in to comment.