Skip to content

Commit

Permalink
Fix clippy warnings.
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Matthews <[email protected]>
  • Loading branch information
jdm committed Feb 4, 2025
1 parent b4b8f4c commit b055489
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rcdom/tests/html-tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ fn mk_tests(tests: &mut Vec<Test>, filename: &str, js: &Value) {
// the input and output.
if obj
.get(&"doubleEscaped".to_string())
.map_or(false, |j| j.get_bool())
.is_some_and(|j| j.get_bool())
{
match unescape(&input) {
None => return,
Expand Down
4 changes: 2 additions & 2 deletions xml5ever/src/tokenizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn process_qname(tag_name: StrTendril) -> QualName {
// a:b
// Since StrTendril are UTF-8, we know that minimal size in bytes must be
// three bytes minimum.
let split = if (*tag_name).as_bytes().len() < 3 {
let split = if (*tag_name).len() < 3 {
None
} else {
QualNameTokenizer::new((*tag_name).as_bytes()).run()
Expand All @@ -71,7 +71,7 @@ fn process_qname(tag_name: StrTendril) -> QualName {
match split {
None => QualName::new(None, ns!(), LocalName::from(&*tag_name)),
Some(col) => {
let len = (*tag_name).as_bytes().len() as u32;
let len = (*tag_name).len() as u32;
let prefix = tag_name.subtendril(0, col);
let local = tag_name.subtendril(col + 1, len - col - 1);
let ns = ns!(); // Actual namespace URL set in XmlTreeBuilder::bind_qname
Expand Down

0 comments on commit b055489

Please sign in to comment.