Skip to main content

get_current_user

Function get_current_user 

Source
pub fn get_current_user() -> String
Expand description

Returns the current username from the environment (cached after first call).

Reads USER, falling back to USERNAME (Windows), and finally to the literal "unknown" if neither is set. The lookup is memoized so a large scan does not re-read the environment once per parsed file.