Use mem::take instead of mem::replace in iced_graphics::Renderer
Thanks to @tarkah for pointing this out!
This commit is contained in:
parent
157a40a568
commit
ef5a731e4b
1 changed files with 2 additions and 4 deletions
|
|
@ -53,8 +53,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
fn with_layer(&mut self, bounds: Rectangle, f: impl FnOnce(&mut Self)) {
|
fn with_layer(&mut self, bounds: Rectangle, f: impl FnOnce(&mut Self)) {
|
||||||
let current_primitives =
|
let current_primitives = std::mem::take(&mut self.primitives);
|
||||||
std::mem::replace(&mut self.primitives, Vec::new());
|
|
||||||
|
|
||||||
f(self);
|
f(self);
|
||||||
|
|
||||||
|
|
@ -74,8 +73,7 @@ where
|
||||||
translation: Vector,
|
translation: Vector,
|
||||||
f: impl FnOnce(&mut Self),
|
f: impl FnOnce(&mut Self),
|
||||||
) {
|
) {
|
||||||
let current_primitives =
|
let current_primitives = std::mem::take(&mut self.primitives);
|
||||||
std::mem::replace(&mut self.primitives, Vec::new());
|
|
||||||
|
|
||||||
f(self);
|
f(self);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue