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

Fix clippy #6

Merged
merged 4 commits into from
Jan 26, 2019
Merged

Fix clippy #6

merged 4 commits into from
Jan 26, 2019

Conversation

kanru
Copy link
Contributor

@kanru kanru commented Jan 26, 2019

No description provided.

Copy link
Owner

@dylanhart dylanhart left a comment

Choose a reason for hiding this comment

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

In response to commit e864117

I appreciate the concern, but I don't think this is the best change for a couple reasons.

  1. It requires v0.4.x version bump due to API change (not that big of a deal)
  2. It is inconsistent with uuid (see Uuid::new_v4())

I would however approve a change that added a Ulid::nil() method for a zero-valued Ulid. This would allow ulid to implement Default the same way as uuid (see its implementation)

@kanru
Copy link
Contributor Author

kanru commented Jan 26, 2019

Uuid v4 by spec must be randomly generated. From that point I agree it's nature that Ulid::new() also generate new value every time.

I like the idea of Ulid::nil() as default as it can be used as placeholder value when needed.

`Ulid::nil()` will return a new Ulid that has all the 128 bits set to
zero. Implement also Default base on that.
@dylanhart
Copy link
Owner

Thank you! Merging

@dylanhart dylanhart merged commit 8afdc77 into dylanhart:master Jan 26, 2019
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.

None yet

2 participants