Update query/src/storages/fuse/io/read/snapshot_history_reader.rs
@@ -31,7 +31,7 @@ impl<'a> TableSnapshotReader<'a> {
limit: Option<usize>,
) -> common_exception::Result<Vec<Arc<TableSnapshot>>> {
let mut snapshots = vec![];
- let mut l = limit.map(|v| v as u64).unwrap_or(u64::MAX);
+ let mut l = limit.map_or((u64::MAX, |v| v as u64);
if l == 0 {
return Ok(snapshots);
