Skip to content

Commit

Permalink
chore: fix new clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
V0ldek committed Oct 2, 2024
1 parent c26cb69 commit b6b5d82
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
8 changes: 4 additions & 4 deletions crates/rsonpath-lib/src/input/mmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ impl Input for MmapInput {

#[inline]
fn seek_backward(&self, from: usize, needle: u8) -> Option<usize> {
return if from < self.last_block_start {
if from < self.last_block_start {
self.mmap.seek_backward(from, needle)
} else {
self.as_padded_input().seek_backward(from, needle)
};
}
}

#[inline]
Expand Down Expand Up @@ -153,11 +153,11 @@ impl Input for MmapInput {

#[inline]
fn seek_non_whitespace_backward(&self, from: usize) -> Option<(usize, u8)> {
return if from < self.last_block_start {
if from < self.last_block_start {
self.mmap.seek_non_whitespace_backward(from)
} else {
self.as_padded_input().seek_non_whitespace_backward(from)
};
}
}

#[inline]
Expand Down
6 changes: 1 addition & 5 deletions crates/rsonpath-lib/src/result/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,7 @@ fn append_block(dest: &mut Vec<u8>, src: &[u8], src_start: usize, read_start: us
fn append_final_block(dest: &mut Vec<u8>, src: &[u8], src_start: usize, read_start: usize, read_end: usize) {
debug!("src_start: {src_start}, read_start: {read_start}, read_end: {read_end}");
debug_assert!(read_end >= src_start);
let in_block_start = if read_start > src_start {
read_start - src_start
} else {
0
};
let in_block_start = read_start.saturating_sub(src_start);
let in_block_end = read_end - src_start;

dest.extend(&src[in_block_start..in_block_end]);
Expand Down
2 changes: 1 addition & 1 deletion crates/rsonpath-syntax/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ fn logical_expr<'q>(q: &'q str, ctx: ParseCtx) -> IResult<&'q str, LogicalExpr,
return fail(SyntaxErrorKind::NonSingularQueryInComparison, q.len(), query_len, rest);
};
if negated {
return fail(SyntaxErrorKind::InvalidNegation, q.len(), 1, rest);
fail(SyntaxErrorKind::InvalidNegation, q.len(), 1, rest)
} else {
Ok((
rest,
Expand Down

0 comments on commit b6b5d82

Please sign in to comment.