Merge pull request #175 from mylvghb/master

fix: otehrs.md 示例1处代码错误
This commit is contained in:
Sunface
2022-03-28 15:43:44 +08:00
committed by GitHub
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);
}
```