Returns the computer name from the COMPUTERNAME environment variable, or "localhost" as fallback.
()
| 128 | |
| 129 | /// Returns the computer name from the COMPUTERNAME environment variable, or "localhost" as fallback. |
| 130 | pub fn get_computer_name() -> String { |
| 131 | std::env::var("COMPUTERNAME").unwrap_or_else(|_| "localhost".to_string()) |
| 132 | } |
| 133 | |
| 134 | #[cfg(test)] |
| 135 | mod tests { |
no outgoing calls
no test coverage detected