Skip to content

Commit

Permalink
Silence clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Dec 16, 2024
1 parent 7507470 commit 683f27a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions minijinja/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@
#![allow(clippy::cognitive_complexity)]
#![allow(clippy::get_first)]
#![allow(clippy::default_constructed_unit_structs)]
#![allow(clippy::needless_borrowed_reference)]
#![allow(clippy::vec_init_then_push)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![deny(missing_docs)]
#![doc(html_logo_url = "https://github.com/mitsuhiko/minijinja/raw/main/artwork/logo-square.png")]
Expand Down
8 changes: 4 additions & 4 deletions minijinja/src/value/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1656,16 +1656,16 @@ impl Iterator for ValueIter {
type Item = Value;

fn next(&mut self) -> Option<Self::Item> {
match &mut self.imp {
&mut ValueIterImpl::Empty => None,
&mut ValueIterImpl::Chars(ref mut offset, ref mut len, ref s) => {
match self.imp {
ValueIterImpl::Empty => None,
ValueIterImpl::Chars(ref mut offset, ref mut len, ref s) => {
(s as &str)[*offset..].chars().next().map(|c| {
*offset += c.len_utf8();
*len -= 1;
Value::from(c)
})
}
&mut ValueIterImpl::Dyn(ref mut iter) => iter.next(),
ValueIterImpl::Dyn(ref mut iter) => iter.next(),
}
}

Expand Down

0 comments on commit 683f27a

Please sign in to comment.