File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ use std::fs;
7
7
use std::fs::{File, OpenOptions};
8
8
use std::io;
9
9
use std::io::prelude::*;
10
- #[cfg(target_os = "unix")]
10
+ #[cfg(target_family = "unix")]
11
11
use std::os::unix;
12
- #[cfg(target_os = "windows")]
12
+ #[cfg(target_family = "windows")]
13
13
use std::os::windows;
14
14
use std::path::Path;
15
15
@@ -65,12 +65,12 @@ fn main() {
65
65
66
66
println!("`ln -s ../b.txt a/c/b.txt`");
67
67
// Create a symbolic link, returns `io::Result<()>`
68
- #[cfg(target_os = "unix")] {
68
+ #[cfg(target_family = "unix")] {
69
69
unix::fs::symlink("../b.txt", "a/c/b.txt").unwrap_or_else(|why| {
70
70
println!("! {:?}", why.kind());
71
71
});
72
72
}
73
- #[cfg(target_os = "windows")] {
73
+ #[cfg(target_family = "windows")] {
74
74
windows::fs::symlink_file("../b.txt", "a/c/b.txt").unwrap_or_else(|why| {
75
75
println!("! {:?}", why.to_string());
76
76
});
You can’t perform that action at this time.
0 commit comments