@@ -262,18 +262,26 @@ impl TestGenerator {
262262 /// Set a `--cfg` option with which to expand the Rust FFI crate.
263263 ///
264264 /// By default the Rust code is run through expansion to determine what C
265- /// APIs are exposed (to allow differences across platforms). The `k`
266- /// argument is the `#[cfg]` value to define, and `v` is an optional value
267- /// for differentiating between `#[cfg(foo)]` and `#[cfg(foo = "bar")]`.
265+ /// APIs are exposed (to allow differences across platforms).
266+ ///
267+ /// The `k` argument is the `#[cfg]` value to define, while `v` is the
268+ /// optional value of `v`:
269+ ///
270+ /// * `k == "foo"` and `v == None` makes `#[cfg(foo)]` expand. That is,
271+ /// `cfg!(foo)` expands to `true`.
272+ ///
273+ /// * `k == "bar"` and `v == Some("baz")` makes `#[cfg(bar = "baz")]`
274+ /// expand. That is, `cfg!(bar = "baz")` expands to `true`.
268275 ///
269276 /// # Examples
270277 ///
271278 /// ```no_run
272279 /// use ctest::TestGenerator;
273280 ///
274281 /// let mut cfg = TestGenerator::new();
275- /// cfg.cfg("foo", None)
276- /// .cfg("bar", Some("baz"));
282+ /// cfg.cfg("foo", None) // cfg!(foo)
283+ /// .cfg("bar", Some("baz")); // cfg!(bar = "baz")
284+ /// ```
277285 pub fn cfg ( & mut self , k : & str , v : Option < & str > ) -> & mut TestGenerator {
278286 self . cfg . push ( ( k. to_string ( ) , v. map ( |s| s. to_string ( ) ) ) ) ;
279287 self
0 commit comments