Skip to main content

written_as_method

Function written_as_method 

Source
pub fn written_as_method(callee: &str) -> bool
Expand description

Whether a callee as written names a receiver rather than a path.

Every language here reports the callee as the source wrote it, and in all of them a . separates a value or a module from the name being called — self.flush, store.flush, os.path.join, pkg.Func. A path uses :: (Rust) or nothing at all, neither of which contains a dot. So one rule covers every grammar, and it is the same rule resolve_call’s candidate splitting already uses to find the last segment.