Skip to content

Conversation

@tisonkun
Copy link
Contributor

Signed-off-by: tison <[email protected]>
} else if let Ok(username) = whoami::username() {
username
} else {
"unknown".to_string()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be better to leave this as an empty string; it might be more confusing that it seems to have detected the username unknown, which could feasibly be a real username.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm OK to return an empty string.

The original behavior of whoami 1.x is returning "unknown" in this case, BTW.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"unknown".to_string()
"".to_string()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to commit this patch if you are sure. I'm considering that returning an empty string can be a breaking change but you make the call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants