Skip to content

Commit

Permalink
for cargo component new generated Cargo.toml adds a good default …
Browse files Browse the repository at this point in the history
…`release.profile` (#289)
  • Loading branch information
calvinrp authored May 7, 2024
1 parent 782584e commit e65e553
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/commands/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,18 @@ impl NewCommand {
doc["lib"]["crate-type"] = value(Value::from_iter(["cdylib"]));
}

// add release profile
let mut release_profile = table();
release_profile["codegen-units"] = value(1);
release_profile["opt-level"] = value("s");
release_profile["debug"] = value(false);
release_profile["strip"] = value(true);
release_profile["lto"] = value(true);
let mut profile = table();
profile.as_table_mut().unwrap().set_implicit(true);
profile["release"] = release_profile;
doc["profile"] = profile;

let mut component = Table::new();
component.set_implicit(true);

Expand Down

0 comments on commit e65e553

Please sign in to comment.