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

[Question] Would it be possible to make ulid::Generator::new() const? #83

Open
emkw opened this issue Oct 24, 2024 · 3 comments
Open

[Question] Would it be possible to make ulid::Generator::new() const? #83

emkw opened this issue Oct 24, 2024 · 3 comments

Comments

@emkw
Copy link

emkw commented Oct 24, 2024

Would it be possible to make ulid::Generator::new() const?

That could be used to statically initialize it, so it wouldn't require lazy initialization.

@dylanhart
Copy link
Owner

dylanhart commented Oct 24, 2024 via email

@emkw
Copy link
Author

emkw commented Oct 24, 2024

Just to make sure - aren't there any future assumptions about generator initialization that const could make problematic?

@dylanhart
Copy link
Owner

I doubt. The only thing that would be non-const would the RNG but that's being passed to generate with the current API.

emkw added a commit to emkw/ulid-rs that referenced this issue Oct 24, 2024
This allows static generator initialization - dylanhart#83
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

No branches or pull requests

2 participants