Skip to content

Commit 0a85201

Browse files
sunshowerssunfishcode
authored andcommitted
Expose cap_std::fs_utf8 in docs.rs
I was trying to use `fs_utf8` for some of my code, and docs.rs didn't have any documentation for it. I'm not sure if this is desired yet, but I wanted to put this PR up to solicit feedback. Also enable doc_cfg + doc_auto_cfg so that docs.rs marks fs_utf8 (and net) as being conditional.
1 parent c1b35d9 commit 0a85201

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

cap-std/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ categories = ["filesystem", "network-programming"]
1212
repository = "https://github.com/bytecodealliance/cap-std"
1313
edition = "2018"
1414

15+
[package.metadata.docs.rs]
16+
rustdoc-args = ["--all-features", "--cfg=doc_cfg"]
17+
1518
[dependencies]
1619
arf-strings = { version = "0.6.3", optional = true }
17-
cap-primitives = { path = "../cap-primitives", version = "^0.22.2-alpha.0"}
20+
cap-primitives = { path = "../cap-primitives", version = "^0.22.2-alpha.0" }
1821
ipnet = "2.3.0"
1922
io-extras = "0.12.0"
2023
io-lifetimes = { version = "0.4.0", default-features = false }

cap-std/src/fs_utf8/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
//!
1616
//! TODO: This whole scheme is still under development.
1717
//!
18-
//! If you don't want this, use the regular [`cap_std::fs`] module instead.
18+
//! To use this module, enable the `fs_utf8` cargo feature.
19+
//!
20+
//! If you don't want to restrict paths to UTF-8, use the regular
21+
//! [`cap_std::fs`] module instead.
1922
//!
2023
//! [`cap_std::fs`]: ../fs/
2124
//! [ARF strings]: https://crates.io/crates/arf-strings

cap-std/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
//! [`Pool`]: net::Pool
2424
2525
#![deny(missing_docs)]
26+
#![cfg_attr(doc_cfg, feature(doc_cfg, doc_auto_cfg))]
2627
#![cfg_attr(target_os = "wasi", feature(wasi_ext))]
2728
#![cfg_attr(can_vector, feature(can_vector))]
2829
#![cfg_attr(seek_convenience, feature(seek_convenience))]

0 commit comments

Comments
 (0)