style: fix formatting after clippy changes
Some checks failed
ci/woodpecker/pr/check Pipeline failed
CI / Check (pull_request) Has been cancelled
CI / Format (pull_request) Has been cancelled
CI / Clippy (pull_request) Has been cancelled
CI / Build (macos-latest) (pull_request) Has been cancelled
CI / Build (ubuntu-latest) (pull_request) Has been cancelled
CI / Build (windows-latest) (pull_request) Has been cancelled
Some checks failed
ci/woodpecker/pr/check Pipeline failed
CI / Check (pull_request) Has been cancelled
CI / Format (pull_request) Has been cancelled
CI / Clippy (pull_request) Has been cancelled
CI / Build (macos-latest) (pull_request) Has been cancelled
CI / Build (ubuntu-latest) (pull_request) Has been cancelled
CI / Build (windows-latest) (pull_request) Has been cancelled
This commit is contained in:
@@ -126,7 +126,11 @@ pub fn format_text_with_entities(
|
|||||||
let start = entity.offset as usize;
|
let start = entity.offset as usize;
|
||||||
let end = (entity.offset + entity.length) as usize;
|
let end = (entity.offset + entity.length) as usize;
|
||||||
|
|
||||||
for item in char_styles.iter_mut().take(end.min(chars.len())).skip(start) {
|
for item in char_styles
|
||||||
|
.iter_mut()
|
||||||
|
.take(end.min(chars.len()))
|
||||||
|
.skip(start)
|
||||||
|
{
|
||||||
match &entity.r#type {
|
match &entity.r#type {
|
||||||
TextEntityType::Bold => item.bold = true,
|
TextEntityType::Bold => item.bold = true,
|
||||||
TextEntityType::Italic => item.italic = true,
|
TextEntityType::Italic => item.italic = true,
|
||||||
@@ -140,9 +144,7 @@ pub fn format_text_with_entities(
|
|||||||
| TextEntityType::TextUrl(_)
|
| TextEntityType::TextUrl(_)
|
||||||
| TextEntityType::EmailAddress
|
| TextEntityType::EmailAddress
|
||||||
| TextEntityType::PhoneNumber => item.url = true,
|
| TextEntityType::PhoneNumber => item.url = true,
|
||||||
TextEntityType::Mention | TextEntityType::MentionName(_) => {
|
TextEntityType::Mention | TextEntityType::MentionName(_) => item.mention = true,
|
||||||
item.mention = true
|
|
||||||
}
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user