MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / is_preferred_by

Method is_preferred_by

src/sql/src/func.rs:774–780  ·  view source on GitHub ↗

Does `t`'s [`TypeCategory`] prefer `self`? This question can make more sense with the understanding that pseudotypes are never preferred.

(&self, t: &SqlScalarType)

Source from the content-addressed store, hash-verified

772 /// Does `t`'s [`TypeCategory`] prefer `self`? This question can make
773 /// more sense with the understanding that pseudotypes are never preferred.
774 fn is_preferred_by(&self, t: &SqlScalarType) -> bool {
775 if let Some(pt) = TypeCategory::from_type(t).preferred_type() {
776 *self == pt
777 } else {
778 false
779 }
780 }
781
782 /// Is `self` the [`ParamType`] corresponding to `t`'s [near match] value?
783 ///

Callers 1

find_matchFunction · 0.80

Calls 1

preferred_typeMethod · 0.80

Tested by

no test coverage detected