Skip to content

Commit

Permalink
Further cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Jan 17, 2024
1 parent 9f40969 commit b657778
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions build_zng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,16 @@ struct Ctx<'ctx> {

impl<'ctx> Ctx<'ctx> {
fn enable(&mut self, tf: TargetFeature) -> bool {
if let Some(enabled) = self.enabled {
if !enabled.contains(tf.check) {
return false;
}
}
let enabled = self
.enabled
.as_ref()
.expect("target features not set for ctx")
.contains(tf.check);

self.push(tf);
true
if enabled {
self.push(tf);
}
enabled
}

fn compile_check(&mut self, subdir: &str, tf: TargetFeature) -> bool {
Expand Down Expand Up @@ -226,7 +228,7 @@ impl<'ctx> Ctx<'ctx> {

impl<'ctx> Drop for Ctx<'ctx> {
fn drop(&mut self) {
let app = std::mem::replace(&mut self.append, Default::default());
let app = std::mem::take(&mut self.append);
for flag in app.flags {
self.cfg.flag(flag);
}
Expand Down

0 comments on commit b657778

Please sign in to comment.