We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49b26bb commit f7094e3Copy full SHA for f7094e3
src/lib.rs
@@ -288,17 +288,9 @@ impl<'a> CSSInliner<'a> {
288
let mut links = document
289
.select("link[rel~=stylesheet]")
290
.map_err(|_| error::InlineError::ParseError(Cow::from("Unknown error")))?
291
- .map(|link_tag| {
292
- link_tag
293
- .attributes
294
- .borrow()
295
- .get("href")
296
- .as_ref()
297
- .unwrap_or_else(|| &"")
298
- .to_string()
299
- })
+ .filter_map(|link_tag| link_tag.attributes.borrow().get("href").map(str::to_string))
300
.collect::<Vec<String>>();
301
- links.sort();
+ links.sort_unstable();
302
links.dedup();
303
for href in &links {
304
if !href.is_empty() {
0 commit comments