whoami icon indicating copy to clipboard operation
whoami copied to clipboard

Make platform-specific functions return `io::Result`, and fallback values in lib.rs

Open AldaronLau opened this issue 3 years ago • 1 comments

Currently, if a platform-specific function fails then it will return "Unknown", "unknown", or "localhost" depending on the function. This functionality should be moved to lib.rs where the platform-independent functions are.

If we do this, then it makes it possible to add a fallible API, ~although I'm not sure if there's any interest in such an API. Either way,~ It will improve the organization of the code and reduce duplication.

AldaronLau avatar Sep 25 '21 19:09 AldaronLau

~If someone wishes to start on this, either wait for #29 to be merged, or base it off that code (to avoid merging issues).~

AldaronLau avatar Sep 25 '21 20:09 AldaronLau