Skip to content

Commit 5421610

Browse files
committed
cargo clean: remove 'release' field'
1 parent 47007d9 commit 5421610

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/bin/cargo/commands/clean.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
3030
spec: values(args, "package"),
3131
target: args.target(),
3232
profile_kind: args.get_profile_kind(config, ProfileKind::Dev, ProfileChecking::Checked)?,
33-
release: args.is_present("release"),
34-
profile_specified: args.is_present("profile"),
33+
profile_specified: args.is_present("profile") || args.is_present("release"),
3534
doc: args.is_present("doc"),
3635
};
3736
ops::clean(&ws, &opts)?;

src/cargo/ops/cargo_clean.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ pub struct CleanOptions<'a> {
1919
/// The target arch triple to clean, or None for the host arch
2020
pub target: Option<String>,
2121
/// Whether to clean the release directory
22-
pub release: bool,
23-
/// Whether a certain build profile was specified
2422
pub profile_specified: bool,
2523
/// Whether to clean the directory of a certain build profile
2624
pub profile_kind: ProfileKind,
@@ -45,10 +43,7 @@ pub fn clean(ws: &Workspace<'_>, opts: &CleanOptions<'_>) -> CargoResult<()> {
4543
// Check for whether the profile is defined.
4644
let _ = profiles.base_profile(&opts.profile_kind)?;
4745

48-
// If the release option is set, we set target to release directory
49-
if opts.release {
50-
target_dir = target_dir.join(profiles.get_dir_name(&ProfileKind::Release));
51-
} else if opts.profile_specified {
46+
if opts.profile_specified {
5247
// After parsing profiles we know the dir-name of the profile, if a profile
5348
// was passed from the command line. If so, delete only the directory of
5449
// that profile.

0 commit comments

Comments
 (0)