MCPcopy Create free account
hub / github.com/astral-sh/ruff / are_same_optional

Function are_same_optional

crates/ruff_python_ast/src/node.rs:754–759  ·  view source on GitHub ↗

Returns `true` if `right` is `Some` and `left` and `right` are referentially equal.

(left: AnyNodeRef, right: Option<T>)

Source from the content-addressed store, hash-verified

752
753/// Returns `true` if `right` is `Some` and `left` and `right` are referentially equal.
754fn are_same_optional<'a, T>(left: AnyNodeRef, right: Option<T>) -> bool
755where
756 T: Into<AnyNodeRef<'a>>,
757{
758 right.is_some_and(|right| left.ptr_eq(right.into()))
759}

Calls 1

ptr_eqMethod · 0.80

Tested by

no test coverage detected