Metadata collection clarifying default configuration values
This commit is contained in:
parent
88ae2d1155
commit
b03642e51f
@ -290,12 +290,22 @@ fn collect_configs() -> Vec<ClippyConfiguration> {
|
||||
lints,
|
||||
doc,
|
||||
config_type: x.config_type,
|
||||
default: x.default.to_string(),
|
||||
default: clarify_default(x.default),
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn clarify_default(default: &'static str) -> String {
|
||||
if let Some((_start, init)) = default.split_once('[') {
|
||||
if let Some((init, _end)) = init.split_once(']') {
|
||||
return format!("[{}]", init);
|
||||
}
|
||||
}
|
||||
|
||||
default.to_string()
|
||||
}
|
||||
|
||||
/// This parses the field documentation of the config struct.
|
||||
///
|
||||
/// ```rust, ignore
|
||||
|
Loading…
x
Reference in New Issue
Block a user