mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Eliminate pointless copies of ImageResponseMsg in the image task.
This commit is contained in:
parent
10d9bad973
commit
853d7c4819
1 changed files with 5 additions and 6 deletions
|
@ -58,13 +58,12 @@ pub enum ImageResponseMsg {
|
||||||
|
|
||||||
impl Eq for ImageResponseMsg {
|
impl Eq for ImageResponseMsg {
|
||||||
fn eq(&self, other: &ImageResponseMsg) -> bool {
|
fn eq(&self, other: &ImageResponseMsg) -> bool {
|
||||||
// FIXME: Bad copies
|
match (self, other) {
|
||||||
match (self.clone(), other.clone()) {
|
(&ImageReady(..), &ImageReady(..)) => fail!("unimplemented comparison"),
|
||||||
(ImageReady(..), ImageReady(..)) => fail!("unimplemented comparison"),
|
(&ImageNotReady, &ImageNotReady) => true,
|
||||||
(ImageNotReady, ImageNotReady) => true,
|
(&ImageFailed, &ImageFailed) => true,
|
||||||
(ImageFailed, ImageFailed) => true,
|
|
||||||
|
|
||||||
(ImageReady(..), _) | (ImageNotReady, _) | (ImageFailed, _) => false
|
(&ImageReady(..), _) | (&ImageNotReady, _) | (&ImageFailed, _) => false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue