parent
124ed5e4ba
commit
1d5f20b46c
1 changed files with 2 additions and 2 deletions
|
@ -78,14 +78,14 @@ impl<'open> Window<'open> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Usage: `Window::new(…).mutate(|w| w.resize = w.resize.auto_expand_width(true))`
|
/// Usage: `Window::new(…).mutate(|w| w.resize = w.resize.auto_expand_width(true))`
|
||||||
/// Not sure this is a good interface for this.
|
// TODO(emilk): I'm not sure this is a good interface for this.
|
||||||
pub fn mutate(mut self, mutate: impl Fn(&mut Self)) -> Self {
|
pub fn mutate(mut self, mutate: impl Fn(&mut Self)) -> Self {
|
||||||
mutate(&mut self);
|
mutate(&mut self);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Usage: `Window::new(…).resize(|r| r.auto_expand_width(true))`
|
/// Usage: `Window::new(…).resize(|r| r.auto_expand_width(true))`
|
||||||
/// Not sure this is a good interface for this.
|
// TODO(emilk): I'm not sure this is a good interface for this.
|
||||||
pub fn resize(mut self, mutate: impl Fn(Resize) -> Resize) -> Self {
|
pub fn resize(mut self, mutate: impl Fn(Resize) -> Resize) -> Self {
|
||||||
self.resize = mutate(self.resize);
|
self.resize = mutate(self.resize);
|
||||||
self
|
self
|
||||||
|
|
Loading…
Reference in a new issue