-
Notifications
You must be signed in to change notification settings - Fork 0
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
API tweaks from real use #2
Conversation
After trying to integrate this into the bulk builder, I've ran into a few little things I needed to change.
.expect("errored before now if url was malformed"), | ||
.as_deref() | ||
.and_then(repo_name_from_url) | ||
.expect("already checked") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's very annoying when these sort of checks hit and don't tell you anything about where the problem occurred. These days I'm fond of unwrap_or_else(|| panic!) so you can report context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using expect here as basically an alternative to a comment; this be unreachable because in order to get here we already called this function once on this input and succeeded.
assert_eq!( | ||
repo_name_from_url("https://github.com/hyper-type/Advent"), | ||
Some("Advent"), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this means we get a collision if font A has org1/a_name as repo and font B has org2/a_name. While perhaps unlikely I tend to think this would be a valid config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree this is possible, but unlikely. Opened #4 to track.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with minor concern about repo name collisons
After trying to integrate this into the bulk builder, I've ran into a few little things I needed to change.