Skip to content

Commit

Permalink
rust lint
Browse files Browse the repository at this point in the history
  • Loading branch information
steelgeek091 committed Apr 23, 2024
1 parent f9bc515 commit 2717091
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/rooch-rpc-server/src/server/rooch_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,11 @@ impl RoochAPIServer for RoochServer {
let start = cursor.unwrap_or(last_sequencer_order + 1);
let start_sub =
start
.checked_sub(limit_of as u64)
.checked_sub(limit_of)
.ok_or(jsonrpsee::core::Error::Custom(
"cursor value is overflow".to_string(),
))?;
let end = if start >= limit_of as u64 {
let end = if start >= limit_of {
start_sub
} else {
0
Expand All @@ -418,7 +418,7 @@ impl RoochAPIServer for RoochServer {
))?;
let start_plus =
start
.checked_add(limit_value as u64)
.checked_add(limit_value)
.ok_or(jsonrpsee::core::Error::Custom(
"cursor value is overflow".to_string(),
))?;
Expand All @@ -435,7 +435,7 @@ impl RoochAPIServer for RoochServer {
.filter_map(|(h, o)| h.map(|h| (h, o)))
.collect::<Vec<_>>();

let has_next_page = (hash_order_pair.len() as u64) > limit_of as u64;
let has_next_page = (hash_order_pair.len() as u64) > limit_of;
hash_order_pair.truncate(limit_of as usize);

let next_cursor = hash_order_pair.last().map_or(cursor, |(_h, o)| Some(*o));
Expand Down

0 comments on commit 2717091

Please sign in to comment.