Skip to content

Commit fe978e0

Browse files
committed
Add comments about std::path::Path's ambient authority functions.
1 parent 208e2e5 commit fe978e0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

cap-async-std/src/fs/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
//! This combined with a lack of absolute paths provides a natural
1515
//! capability-oriented interface.
1616
//!
17+
//! This crate uses the existing `std::path::Path` rather than having its own
18+
//! path type, however while `std::path::Path` is mostly just a pure datatype,
19+
//! it includes aliases for several `std::fs` functions. To preserve the
20+
//! capability-oriented interface, avoid using `std::path::Path`'s
21+
//! `canonicalize`, `read_link`, `read_dir`, `metadata`, and `symlink_metadata`
22+
//! functions.
23+
//!
1724
//! [`async_std::fs`]: https://docs.rs/async-std/latest/async_std/fs/
1825
//! [`async_std::fs`'s free functions]: https://docs.rs/async-std/latest/async_std/fs/#functions
1926
//! [`async_std::fs::File`]: https://docs.rs/async-std/latest/async_std/fs/struct.File.html

cap-std/src/fs/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
//! This combined with a lack of absolute paths provides a natural
1515
//! capability-oriented interface.
1616
//!
17+
//! This crate uses the existing `std::path::Path` rather than having its own
18+
//! path type, however while `std::path::Path` is mostly just a pure datatype,
19+
//! it includes aliases for several `std::fs` functions. To preserve the
20+
//! capability-oriented interface, avoid using `std::path::Path`'s
21+
//! `canonicalize`, `read_link`, `read_dir`, `metadata`, and `symlink_metadata`
22+
//! functions.
23+
//!
1724
//! [`std::fs`]: https://doc.rust-lang.org/std/fs/
1825
//! [`std::fs`'s free functions]: https://doc.rust-lang.org/std/fs/#functions
1926
//! [`std::fs::File`]: https://doc.rust-lang.org/std/fs/struct.File.html

0 commit comments

Comments
 (0)