Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use bail before stringifying name #19

Merged
merged 1 commit into from
Sep 25, 2023
Merged

refactor: use bail before stringifying name #19

merged 1 commit into from
Sep 25, 2023

Conversation

lavafroth
Copy link
Contributor

This is a rather simple refactor. When the .to_str() on the path returns a None or some empty string, we use anyhow::bail to bail out of the function instead of using a default value and stringifying it. For any other values, the code goes the happy path.

@ThePrimeagen
Copy link
Owner

fair change, catches the None and "" case well

@ThePrimeagen ThePrimeagen merged commit cb9982d into ThePrimeagen:master Sep 25, 2023
1 check passed
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