Rename cx.global_default_mut to cx.global_default

This commit is contained in:
Marshall Bowers 2023-10-24 17:58:14 +02:00
parent 4ca7ddfc42
commit d6bd000aa8
14 changed files with 52 additions and 50 deletions

View file

@ -764,7 +764,7 @@ pub struct GroupBounds(HashMap<SharedString, SmallVec<[Bounds<Pixels>; 1]>>);
impl GroupBounds {
pub fn get(name: &SharedString, cx: &mut AppContext) -> Option<Bounds<Pixels>> {
cx.default_global_mut::<Self>()
cx.default_global::<Self>()
.0
.get(name)
.and_then(|bounds_stack| bounds_stack.last())
@ -772,7 +772,7 @@ impl GroupBounds {
}
pub fn push(name: SharedString, bounds: Bounds<Pixels>, cx: &mut AppContext) {
cx.default_global_mut::<Self>()
cx.default_global::<Self>()
.0
.entry(name)
.or_default()
@ -780,7 +780,7 @@ impl GroupBounds {
}
pub fn pop(name: &SharedString, cx: &mut AppContext) {
cx.default_global_mut::<Self>()
cx.default_global::<Self>()
.0
.get_mut(name)
.unwrap()