Skip to content

Commit

Permalink
Fix warning in release mode (#3662)
Browse files Browse the repository at this point in the history
This PR fixes a warning that was present in release mode, which was
preventing the nightly builds from running:

```
error: variable does not need to be mutable
   --> crates/gpui2/src/elements/div.rs:547:9
    |
547 |     let mut div = Div {
    |         ----^^^
    |         |
    |         help: remove this `mut`
    |
    = note: `-D unused-mut` implied by `-D warnings`
```

Release Notes:

- N/A
  • Loading branch information
maxdeviant authored Dec 14, 2023
1 parent 139fe7c commit bc3e664
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions crates/gpui2/src/elements/div.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,17 +544,20 @@ pub type ActionListener = Box<dyn Fn(&dyn Any, DispatchPhase, &mut WindowContext

#[track_caller]
pub fn div() -> Div {
let mut div = Div {
interactivity: Interactivity::default(),
children: SmallVec::default(),
#[cfg(debug_assertions)]
let interactivity = {
let mut interactivity = Interactivity::default();
interactivity.location = Some(*core::panic::Location::caller());
interactivity
};

#[cfg(debug_assertions)]
{
div.interactivity.location = Some(*core::panic::Location::caller());
}
#[cfg(not(debug_assertions))]
let interactivity = Interactivity::default();

div
Div {
interactivity,
children: SmallVec::default(),
}
}

pub struct Div {
Expand Down

0 comments on commit bc3e664

Please sign in to comment.