@@ -88,7 +88,7 @@ impl Toml {
88
88
) ;
89
89
std:: env:: set_current_dir ( working_directory) ?;
90
90
91
- let parameters = construct_build_parameters_from_toml_table ( toml_type, table) ?;
91
+ let parameters = construct_build_parameters_from_toml_table ( toml_type, & table) ?;
92
92
log:: debug!( "build parameters: {parameters:#?}" ) ;
93
93
if let Cli {
94
94
command : Command :: Build ( mut build) ,
@@ -143,24 +143,15 @@ impl Toml {
143
143
/// Construct the cli parameters to run a `cargo gpu build` command from a TOML table.
144
144
fn construct_build_parameters_from_toml_table (
145
145
toml_type : & str ,
146
- mut table : toml:: map:: Map < String , toml:: Value > ,
146
+ table : & toml:: map:: Map < String , toml:: Value > ,
147
147
) -> Result < Vec < String > , anyhow:: Error > {
148
148
let build_table = table
149
- . get_mut ( "build" )
149
+ . get ( "build" )
150
150
. with_context ( || "toml is missing the 'build' table" ) ?
151
- . as_table_mut ( )
151
+ . as_table ( )
152
152
. with_context ( || {
153
153
format ! ( "toml file's '{toml_type}.metadata.rust-gpu.build' property is not a table" )
154
154
} ) ?;
155
- let auto_install_rust_toolchain = if build_table. contains_key ( "auto_install_rust_toolchain" ) {
156
- build_table
157
- . remove ( "auto_install_rust_toolchain" )
158
- . context ( "unreachable" ) ?
159
- . as_bool ( )
160
- . context ( "auto_install_rust_toolchain must be bool" ) ?
161
- } else {
162
- false
163
- } ;
164
155
let mut parameters: Vec < String > = build_table
165
156
. into_iter ( )
166
157
. map ( |( key, val) | -> anyhow:: Result < Vec < String > > {
@@ -191,8 +182,5 @@ fn construct_build_parameters_from_toml_table(
191
182
. collect ( ) ;
192
183
parameters. insert ( 0 , "cargo-gpu" . to_owned ( ) ) ;
193
184
parameters. insert ( 1 , "build" . to_owned ( ) ) ;
194
- if auto_install_rust_toolchain {
195
- parameters. push ( "--auto_install_rust_toolchain" . to_owned ( ) ) ;
196
- }
197
185
Ok ( parameters)
198
186
}
0 commit comments