We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Config::get_tool()
1 parent 94bf478 commit 97d9608Copy full SHA for 97d9608
src/cargo/util/config/mod.rs
@@ -873,9 +873,17 @@ impl Config {
873
return Ok(Some(path));
874
}
875
876
- let var = format!("build.{}", tool);
877
- if let Some(tool_path) = self.get_path(&var)? {
878
- return Ok(Some(tool_path.val));
+ // For backwards compatibility we allow both snake_case config paths as well as the
+ // idiomatic kebab-case paths.
+ let config_paths = [
879
+ format!("build.{}", tool),
880
+ format!("build.{}", tool.replace('_', "-")),
881
+ ];
882
+
883
+ for config_path in &config_paths {
884
+ if let Some(tool_path) = self.get_path(&config_path)? {
885
+ return Ok(Some(tool_path.val));
886
+ }
887
888
889
Ok(None)
0 commit comments