pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/RustPython/RustPython/commit/436f9849503ab838fe2cc59a25ae6517aafec408

c08.css" /> clean up PyComparisonOp::map_eq · RustPython/RustPython@436f984 · GitHub
Skip to content

Commit 436f984

Browse files
committed
clean up PyComparisonOp::map_eq
1 parent 3b9721c commit 436f984

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

vm/src/types/slot.rs

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -776,22 +776,15 @@ impl PyComparisonOp {
776776
//github.com/ is `Ne` and `f()` returns true. Otherwise returns `None`.
777777
#[inline]
778778
pub fn map_eq(self, f: impl FnOnce() -> bool) -> Option<bool> {
779-
match self {
780-
Self::Eq => {
781-
if f() {
782-
Some(true)
783-
} else {
784-
None
785-
}
786-
}
787-
Self::Ne => {
788-
if f() {
789-
Some(false)
790-
} else {
791-
None
792-
}
793-
}
794-
_ => None,
779+
let eq = match self {
780+
Self::Eq => true,
781+
Self::Ne => false,
782+
_ => return None,
783+
};
784+
if f() {
785+
Some(eq)
786+
} else {
787+
None
795788
}
796789
}
797790
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy