Skip to main content

module_part

Function module_part 

Source
pub fn module_part(id: &str) -> &str
Expand description

Extract the module part of a dot-qualified identifier — the first segment, before any dot.

"main.Point.sum""main", "prelude.Option""prelude", "foo""foo". For go:net/http.Handler-style ids, returns "go:net/http". When the id has no dot at all, returns the id itself (the caller is responsible for handling the no-module case).