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’s dylint.toml file contains key name and its value can be deserialized as T
  • Ok(None) if the target workspace’s dylint.toml file does not exist or does not contain key name
  • Err(...) if an error occurs (e.g., the value cannot be deserialized as T)

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.