Skip to content

Commit

Permalink
Clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
01mf02 committed Dec 9, 2024
1 parent b9317bd commit b7f9268
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jaq-core/src/load/lex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub enum Expect<S> {
Token,
}

impl<'a> Expect<&'a str> {
impl Expect<&str> {
/// Return human-readable description of what we expected.
pub fn as_str(&self) -> &'static str {
match self {
Expand Down
2 changes: 1 addition & 1 deletion jaq-core/src/rc_lazy_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub struct List<'a, T>(Rc<Lazy<Node<'a, T>, Eval<'a, T>>>);
struct Node<'a, T>(Option<(T, List<'a, T>)>);
type Eval<'a, T> = Box<dyn FnOnce() -> Node<'a, T> + 'a>;

impl<'a, T> Drop for List<'a, T> {
impl<T> Drop for List<'_, T> {
fn drop(&mut self) {
while let Some((_head, tail)) = Rc::get_mut(&mut self.0)
.and_then(Lazy::get_mut)
Expand Down
2 changes: 1 addition & 1 deletion jaq-json/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ fn parse_fun() -> Filter<RunPtr<Val>> {
}

fn skip_take(from: usize, until: usize) -> (usize, usize) {
(from, if until > from { until - from } else { 0 })
(from, until.saturating_sub(from))
}

/// If a range bound is given, absolutise and clip it between 0 and `len`,
Expand Down

0 comments on commit b7f9268

Please sign in to comment.