Fix is_release_profile Logic (#4091)
* fix `is_release_profile` logic * fix: don't merge wasm-split modules with asset system, don't compress randomly --------- Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
1 parent
06aaf15d83
commit
18477a0373
2 files changed
+11
-7
No files matched your search
@@ -107,16 +107,16 @@ impl Workspace {
|
||||
}
|
||||
|
||||
pub fn is_release_profile(&self, profile: &str) -> bool {
|
||||
if profile == "release" {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check if the profile inherits from release by traversing the `inherits` chain
|
||||
let mut current_profile_name = profile;
|
||||
|
||||
// Try to find the current profile in the custom profiles section
|
||||
while let Some(profile_settings) = self.cargo_toml.profile.custom.get(current_profile_name)
|
||||
{
|
||||
if profile == "release" {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check what this profile inherits from
|
||||
match &profile_settings.inherits {
|
||||
// Otherwise, continue checking the profile it inherits from
|
||||
@@ -126,6 +126,10 @@ impl Workspace {
|
||||
// Since it didn't lead to "release", return false.
|
||||
None => break,
|
||||
}
|
||||
|
||||
if current_profile_name == "release" {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
false
|
||||
|
||||
Reference in new issue
Block a user