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

Update docs, add convenience implementations #8

Merged
merged 3 commits into from
Oct 10, 2024
Merged

Update docs, add convenience implementations #8

merged 3 commits into from
Oct 10, 2024

Conversation

jssblck
Copy link
Member

@jssblck jssblck commented Oct 9, 2024

Overview

Update the docs for org_id to specify when users might see this and what they should do about it.

Also, I've added a few convenience things I've been wanting:

  • Macros for static construction at compile time. No more Locator::parse(...).expect(...)!
  • AsRef impls for all locators.
  • FromStr impls for all locators, so now we can use str::parse.

Acceptance criteria

  • Docs explain org_id better.
  • Types in this package are easier to construct and use.

Testing plan

All changes, other than the doc changes, are covered with automated tests.

Risks

No real risk.

References

None.

Checklist

  • I added tests for this PR's change (or explained in the PR description why tests don't make sense).

@jssblck jssblck requested review from a team and JeffreyHuynh1 and removed request for a team October 9, 2024 18:10
Copy link

@JeffreyHuynh1 JeffreyHuynh1 left a comment

Choose a reason for hiding this comment

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

The macros look great!. Thanks for updating the docs.

Was gonna suggest that we add a test(s) for the failure cases of the from_str impl, but because it's just calling parse I don't think that's necessary because those cases are already covered in the existing tests.

Comment on lines +424 to +426
const_assert!(impls!(Locator: AsRef<Locator>));
const_assert!(impls!(Locator: FromStr));
const_assert!(impls!(Locator: From<StrictLocator>));

Choose a reason for hiding this comment

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

This is really cool, didn't know about the impls macro

@jssblck jssblck merged commit bb2bfb0 into main Oct 10, 2024
10 checks passed
@jssblck jssblck deleted the docs-and-ux branch October 10, 2024 17:44
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