File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -194,11 +194,11 @@ pub fn config() -> Result<Option<Config>> {
194194 }
195195}
196196
197- pub struct Profile {
198- table : Value ,
197+ pub struct Profile < ' t > {
198+ table : & ' t Value ,
199199}
200200
201- impl Profile {
201+ impl < ' t > Profile < ' t > {
202202 pub fn hash < H > ( & self , hasher : & mut H )
203203 where
204204 H : Hasher ,
@@ -218,13 +218,9 @@ impl Profile {
218218
219219 v. to_string ( ) . hash ( hasher) ;
220220 }
221-
222- pub fn set_lto ( & mut self ) {
223- self . table . as_table_mut ( ) . expect ( "[profile.release] not a table" ) . insert ( "lto" . into ( ) , Value :: Boolean ( true ) ) ;
224- }
225221}
226222
227- impl fmt:: Display for Profile {
223+ impl < ' t > fmt:: Display for Profile < ' t > {
228224 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
229225 let mut map = toml:: map:: Map :: new ( ) ;
230226 map. insert ( "profile" . to_owned ( ) , {
@@ -247,7 +243,7 @@ impl Toml {
247243 self . table
248244 . get ( "profile" )
249245 . and_then ( |v| v. get ( "release" ) )
250- . map ( |t| Profile { table : t. clone ( ) } )
246+ . map ( |t| Profile { table : t } )
251247 }
252248}
253249
Original file line number Diff line number Diff line change @@ -74,11 +74,8 @@ fn build_crate(
7474
7575 let target_dir = td. join ( "target" ) ;
7676
77- if let Some ( mut profile) = ctoml. profile ( ) {
78- profile. set_lto ( ) ;
77+ if let Some ( profile) = ctoml. profile ( ) {
7978 stoml. push_str ( & profile. to_string ( ) )
80- } else {
81- stoml. push_str ( "[profile.release]\n lto = true" ) ;
8279 }
8380
8481 util:: write ( & td. join ( "Cargo.toml" ) , & stoml) ?;
You can’t perform that action at this time.
0 commit comments