Function dylint_linting::config
source · pub fn config<T: DeserializeOwned>(name: &str) -> ConfigResult<Option<T>>
Expand description
Reads and deserializes an entry from the workspace’s dylint.toml
file.
Returns:
Ok(Some(...))
if the target workspace’sdylint.toml
file contains keyname
and its value can be deserialized asT
Ok(None)
if the target workspace’sdylint.toml
file does not exist or does not contain keyname
Err(...)
if an error occurs (e.g., the value cannot be deserialized asT
)
Note: init_config
or try_init_config
must be called before config
is called. However, the
register_lints
function generated by impl_late_lint
, etc. includes a call to init_config
.