mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
refactor(dehtml): remove Result unwrap in dehtml_starttag_cb()
This commit is contained in:
@@ -139,13 +139,12 @@ fn dehtml_starttag_cb<B: std::io::BufRead>(
|
|||||||
dehtml.add_text = AddText::YesPreserveLineEnds;
|
dehtml.add_text = AddText::YesPreserveLineEnds;
|
||||||
}
|
}
|
||||||
"a" => {
|
"a" => {
|
||||||
if let Some(href) = event.html_attributes().find(|attr| {
|
if let Some(href) = event
|
||||||
attr.as_ref()
|
.html_attributes()
|
||||||
.map(|a| String::from_utf8_lossy(a.key).trim().to_lowercase() == "href")
|
.filter_map(|attr| attr.ok())
|
||||||
.unwrap_or_default()
|
.find(|attr| String::from_utf8_lossy(attr.key).trim().to_lowercase() == "href")
|
||||||
}) {
|
{
|
||||||
let href = href
|
let href = href
|
||||||
.unwrap()
|
|
||||||
.unescape_and_decode_value(reader)
|
.unescape_and_decode_value(reader)
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.to_lowercase();
|
.to_lowercase();
|
||||||
|
|||||||
Reference in New Issue
Block a user