@@ -96,13 +96,14 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
96
96
. cloned ( )
97
97
. collect :: < Vec < _ > > ( ) ;
98
98
99
- let section = parse_section ( args) ;
99
+ let ( section, fallback_search_sections ) = parse_section ( args) ;
100
100
101
101
let options = RemoveOptions {
102
102
config,
103
103
spec,
104
104
dependencies,
105
105
section,
106
+ fallback_search_sections,
106
107
dry_run,
107
108
} ;
108
109
remove ( & options) ?;
@@ -134,26 +135,38 @@ pub fn exec(config: &mut Config, args: &ArgMatches) -> CliResult {
134
135
Ok ( ( ) )
135
136
}
136
137
137
- fn parse_section ( args : & ArgMatches ) -> DepTable {
138
+ fn parse_section ( args : & ArgMatches ) -> ( DepTable , Vec < DepTable > ) {
138
139
let dev = args. flag ( "dev" ) ;
139
140
let build = args. flag ( "build" ) ;
140
141
142
+ let mut search_kinds = Vec :: new ( ) ;
143
+
141
144
let kind = if dev {
145
+ search_kinds. extend_from_slice ( & [ DepKind :: Build , DepKind :: Normal ] ) ;
142
146
DepKind :: Development
143
147
} else if build {
148
+ search_kinds. extend_from_slice ( & [ DepKind :: Development , DepKind :: Normal ] ) ;
144
149
DepKind :: Build
145
150
} else {
151
+ search_kinds. extend_from_slice ( & [ DepKind :: Build , DepKind :: Development ] ) ;
146
152
DepKind :: Normal
147
153
} ;
148
154
149
155
let mut table = DepTable :: new ( ) . set_kind ( kind) ;
150
-
156
+ let mut search_tables = search_kinds
157
+ . iter ( )
158
+ . map ( |k| DepTable :: new ( ) . set_kind ( * k) )
159
+ . collect :: < Vec < _ > > ( ) ;
151
160
if let Some ( target) = args. get_one :: < String > ( "target" ) {
152
161
assert ! ( !target. is_empty( ) , "Target specification may not be empty" ) ;
153
162
table = table. set_target ( target) ;
163
+ search_tables = search_tables
164
+ . into_iter ( )
165
+ . map ( |t| t. set_target ( target. clone ( ) ) )
166
+ . collect :: < Vec < _ > > ( ) ;
154
167
}
155
168
156
- table
169
+ ( table, search_tables )
157
170
}
158
171
159
172
/// Clean up the workspace.dependencies, profile, patch, and replace sections of the root manifest
0 commit comments