Skip to content

Commit 4468924

Browse files
committed
fix clippy
1 parent f72c54f commit 4468924

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

core/src/coroutine/korosensei.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ impl<'c, Param, Yield, Return> Coroutine<'c, Param, Yield, Return> {
5757
any(target_os = "linux", target_os = "android"),
5858
target_arch = "x86",
5959
))] {
60-
let sp = context.uc_mcontext.gregs[usize::try_from(libc::REG_ESP).expect("overflow")];
61-
println!("the sp:{sp}");
62-
let sp = sp..try_into().unwrap();
60+
let sp = context.uc_mcontext.gregs[usize::try_from(libc::REG_ESP)
61+
.unwrap_or_else(|| panic!("{} overflow", libc::REG_ESP))].try_into().unwrap();
6362
} else if #[cfg(all(target_vendor = "apple", target_arch = "x86_64"))] {
6463
let sp = u64::try_from((*context.uc_mcontext).__ss.__rsp).expect("overflow");
6564
} else if #[cfg(all(

0 commit comments

Comments
 (0)