Skip to content

Commit 648acb4

Browse files
gyscosclaude
andcommitted
Avoid let...else in the seekable callbacks
It needs Rust 1.65, while every manifest declares 1.64, so building zstd-safe with the seekable feature failed on the MSRV. A match keeps the declared version honest for every feature combination. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TeZDBS4Uw5kdF77tkJ7cAe
1 parent e1152c1 commit 648acb4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎zstd-safe/src/seekable.rs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,10 @@ unsafe extern "C" fn advanced_seek<S: std::io::Seek>(
586586
let seeker: &mut S = std::mem::transmute(opaque);
587587
let pos = match origin {
588588
SEEK_SET => {
589-
let Ok(offset) = u64::try_from(offset) else {
590-
return -1;
589+
// `let .. else` would read better, but it needs Rust 1.65.
590+
let offset = match u64::try_from(offset) {
591+
Ok(offset) => offset,
592+
Err(_) => return -1,
591593
};
592594
SeekFrom::Start(offset)
593595
}

0 commit comments

Comments
 (0)