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

Add a safe "into_data()" method to turn Words into i32s #277

Merged
merged 2 commits into from
Sep 16, 2023

Conversation

jamesmunns
Copy link
Contributor

No description provided.

@jamesmunns jamesmunns changed the title Add a safe "as_data()" method to turn Words into i32s Add a safe "into_data()" method to turn Words into i32s Sep 16, 2023
@@ -55,6 +55,11 @@ impl Word {
}
}

#[inline]
pub fn into_data(self) -> i32 {
Copy link
Contributor

Choose a reason for hiding this comment

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

tbh, i would be equally fine with just calling this data(). but, up to you, it is technically an into conversion... 🤷‍♀️

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Word::data(i32) is already the (safe) constructor, though that might be equally poorly named.

@jamesmunns jamesmunns merged commit 3acd0df into main Sep 16, 2023
@jamesmunns jamesmunns deleted the james/less-unsafe branch September 16, 2023 03:06
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