fix: otehrs.md 示例1处代码错误

This commit is contained in:
daves
2022-03-28 14:41:29 +08:00
parent 844e57c09c
commit 0b95827bf9
2 changed files with 4 additions and 2 deletions

View File

@ -99,7 +99,8 @@ fn foo() -> i32 {
fn main() {
let pointer = foo as *const ();
let function = unsafe {
std::mem::transmute::<*const (), fn() -> i32>(pointer)
std::mem::transmute::<*const (), fn() -> i32>(pointer)
};
assert_eq!(function(), 0);
}
```

View File

@ -100,7 +100,8 @@ fn foo() -> i32 {
fn main() {
let pointer = foo as *const ();
let function = unsafe {
std::mem::transmute::<*const (), fn() -> i32>(pointer)
std::mem::transmute::<*const (), fn() -> i32>(pointer)
};
assert_eq!(function(), 0);
}
```