1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 05:10:03 -04:00

misc clippy fixes from 1.60.0

This commit is contained in:
Emil Ernerfeldt
2022-04-07 17:03:19 +02:00
parent dffab1c737
commit 7cd285ecbc
12 changed files with 30 additions and 45 deletions

View File

@@ -404,7 +404,7 @@ impl Highlighter {
while !text.is_empty() {
if text.starts_with("//") {
let end = text.find('\n').unwrap_or_else(|| text.len());
let end = text.find('\n').unwrap_or(text.len());
job.append(&text[..end], 0.0, theme.formats[TokenType::Comment].clone());
text = &text[end..];
} else if text.starts_with('"') {
@@ -412,7 +412,7 @@ impl Highlighter {
.find('"')
.map(|i| i + 2)
.or_else(|| text.find('\n'))
.unwrap_or_else(|| text.len());
.unwrap_or(text.len());
job.append(
&text[..end],
0.0,