Skip to content

Commit acdf24e

Browse files
committed
update
1 parent 7fd7972 commit acdf24e

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

crates/rs-os/readme.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# rs-os
2+
3+
- OS 操作系统 API 相关的库 & 使用示例.
4+
5+
## rs-cross:
6+
7+
- 跨平台相关的库
8+
9+
### libs:
10+
11+
- [try-notify](./rs-cross/try-notify): 系统通知(macOS/Windows/Linux)
12+
- 基于: https://github.com/hoodie/notify-rust
Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
#[cfg(target_os = "macos")]
2+
fn main() -> Result<(), Box<dyn std::error::Error>> {
3+
use notify_rust::Notification;
4+
5+
Notification::new()
6+
.summary("Safari Crashed")
7+
.body("Just kidding, this is just the notify_rust example.")
8+
.appname("Toastify")
9+
.icon("Toastify")
10+
.show()?;
11+
12+
Ok(())
13+
}
14+
15+
#[cfg(all(unix, not(target_os = "macos")))]
16+
fn main() {
17+
println!("this is a mac only feature")
18+
}
19+
20+
#[cfg(target_os = "windows")]
121
fn main() {
2-
println!("Hello, world!");
22+
println!("this is a mac only feature")
323
}

0 commit comments

Comments
 (0)