mirror of
https://github.com/actix/actix-web.git
synced 2024-12-28 19:10:36 +00:00
fix condition
This commit is contained in:
parent
ebc59cf7b9
commit
75eec8bd4f
1 changed files with 2 additions and 2 deletions
|
@ -224,7 +224,7 @@ where
|
||||||
let h = self.hnd.as_ref().hnd.clone();
|
let h = self.hnd.as_ref().hnd.clone();
|
||||||
// Enforce invariants before entering unsafe code.
|
// Enforce invariants before entering unsafe code.
|
||||||
// Only two references could exists With struct owns one, and line above
|
// Only two references could exists With struct owns one, and line above
|
||||||
if Rc::weak_count(&h) != 0 && Rc::strong_count(&h) != 2 {
|
if Rc::weak_count(&h) != 0 || Rc::strong_count(&h) != 2 {
|
||||||
panic!("Multiple copies of handler are in use")
|
panic!("Multiple copies of handler are in use")
|
||||||
}
|
}
|
||||||
let hnd: &mut F = unsafe { &mut *h.as_ref().get() };
|
let hnd: &mut F = unsafe { &mut *h.as_ref().get() };
|
||||||
|
@ -384,7 +384,7 @@ where
|
||||||
let h = self.hnd.as_ref().hnd.clone();
|
let h = self.hnd.as_ref().hnd.clone();
|
||||||
// Enforce invariants before entering unsafe code.
|
// Enforce invariants before entering unsafe code.
|
||||||
// Only two references could exists With struct owns one, and line above
|
// Only two references could exists With struct owns one, and line above
|
||||||
if Rc::weak_count(&h) != 0 && Rc::strong_count(&h) != 2 {
|
if Rc::weak_count(&h) != 0 || Rc::strong_count(&h) != 2 {
|
||||||
panic!("Multiple copies of handler are in use")
|
panic!("Multiple copies of handler are in use")
|
||||||
}
|
}
|
||||||
let hnd: &mut F = unsafe { &mut *h.as_ref().get() };
|
let hnd: &mut F = unsafe { &mut *h.as_ref().get() };
|
||||||
|
|
Loading…
Reference in a new issue