Fix warning in release mode (#3662)

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
This commit is contained in:
Marshall Bowers
2023-12-14 18:52:14 -05:00
committed by GitHub
parent 139fe7c1f1
commit bc3e6649f8
+11 -8
View File
@@ -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 {