Skip to content

Commit a4d6f31

Browse files
committed
Use wrapping funcs instead of fnalias
1 parent 787a781 commit a4d6f31

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ task example/shapes:run
5252
## Example: [sudo](./sudo)
5353

5454
```bash
55-
task example/shapes:run
55+
task example/sudo:run
5656
```
5757

5858
No screenshot. This example only logs things to the console.

src/misc.mbt

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ pub fn log_error(s : String) -> Unit {
1616

1717
///|
1818
/// Set the random seed.
19-
pub fnalias @ffi.set_seed
19+
#inline
20+
pub fn set_seed(seed : UInt) -> Unit {
21+
@ffi.set_seed(seed)
22+
}
2023

2124
///|
2225
/// Get a random value.
23-
pub fnalias @ffi.get_random
26+
#inline
27+
pub fn get_random() -> UInt {
28+
@ffi.get_random()
29+
}
2430

2531
///|
2632
/// Get name of the device.
@@ -33,8 +39,12 @@ pub fn get_name(peer : UInt) -> String {
3339

3440
///|
3541
/// Restart the app after the current update is finished.
36-
pub fnalias @ffi.restart
42+
pub fn restart() -> Unit {
43+
@ffi.restart()
44+
}
3745

3846
///|
3947
/// Exit the app after the current update is finished.
40-
pub fnalias @ffi.quit
48+
pub fn quit() -> Unit {
49+
@ffi.quit()
50+
}

0 commit comments

Comments
 (0)