File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -588,18 +588,18 @@ fn normalize_toml(
588588}
589589
590590fn field_requires_package_error ( field : & str , has_workspace : bool ) -> anyhow:: Error {
591- let toml_brackets = if matches ! ( field, "bin" | "example" | "test" | "bench" ) {
591+ let ( table_open , table_close ) = if matches ! ( field, "bin" | "example" | "test" | "bench" ) {
592592 ( "[[" , "]]" )
593593 } else {
594594 ( "[" , "]" )
595595 } ;
596- let toml_table = format_args ! ( "{}{field}{}" , toml_brackets. 0 , toml_brackets. 1 ) ;
597- let suggest_workspace = has_workspace
598- && matches ! (
596+ let toml_table = format_args ! ( "{table_open}{field}{table_close}" ) ;
597+ let inheritable = matches ! (
599598 field,
600599 "dependencies" | "dev-dependencies" | "build-dependencies" | "lints"
601600 ) ;
602- let help = if suggest_workspace {
601+ let suggest_template = has_workspace && inheritable;
602+ let help = if suggest_template {
603603 format_args ! (
604604 "\n help: you can use `[workspace.{field}]` to define a template for workspace members to inherit from"
605605 )
You can’t perform that action at this time.
0 commit comments