Skip to content

Commit 5be78d9

Browse files
committed
Touch up CfgEvaluator doc comments
1 parent 38b5842 commit 5be78d9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

gen/src/mod.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub struct Opt {
5454
/// Rust code from one shared object or executable depends on these C++
5555
/// functions in another.
5656
pub cxx_impl_annotations: Option<String>,
57-
/// Optional [`CfgEvaluator`] for handling cfg attributes
57+
/// Impl for handling conditional compilation attributes.
5858
pub cfg_evaluator: Box<dyn CfgEvaluator>,
5959

6060
pub(super) gen_header: bool,
@@ -63,21 +63,23 @@ pub struct Opt {
6363
pub(super) doxygen: bool,
6464
}
6565

66-
/// An evaluator which parses cfg attributes
66+
/// Logic to decide whether a conditional compilation attribute is enabled or
67+
/// disabled.
6768
pub trait CfgEvaluator {
68-
/// For a given cfg name and value return a [`CfgResult`] indicating if it's enabled
69+
/// A name-only attribute such as `cfg(ident)` is passed with a `value` of
70+
/// None, while `cfg(key = "value")` is passed with the "value" in `value`.
6971
fn eval(&self, name: &str, value: Option<&str>) -> CfgResult;
7072
}
7173

72-
/// Results of a [`CfgEvaluator`]
74+
/// Result of a [`CfgEvaluator`] evaluation.
7375
pub enum CfgResult {
74-
/// cfg option is enabled
76+
/// Cfg option is enabled.
7577
True,
76-
/// cfg option is disabled
78+
/// Cfg option is disabled.
7779
False,
78-
/// cfg option is not enabled or disabled
80+
/// Cfg option is neither enabled nor disabled.
7981
Undetermined {
80-
/// Custom message explaining why the cfg option is undetermined
82+
/// Message explaining why the cfg option is undetermined.
8183
msg: String,
8284
},
8385
}

0 commit comments

Comments
 (0)