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 collections.md - simplified entry API example #140

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

jonathanpallant
Copy link
Member

Simplify the entry API example, as the &'static str doesn't add value here, and the entry API isn't actually very useful when you have non-Copy owned keys (like String) because you are forced to heap-allocate the String even if the key already exists.

Simplify the entry API example, as the `&'static str` doesn't add value here, and the entry API isn't actually very useful when you have non-Copy owned keys (like `String`) because you are forced to heap-allocate the String even if the key already exists.
Copy link
Contributor

@miguelraz miguelraz left a comment

Choose a reason for hiding this comment

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

Sweet, that does remove some mental overhead for the trainees.

@jonathanpallant jonathanpallant merged commit 99da0e6 into main Feb 28, 2024
2 checks passed
@jonathanpallant jonathanpallant deleted the jonathanpallant-patch-2 branch March 11, 2024 13:00
miguelraz pushed a commit that referenced this pull request Dec 24, 2024
Simplify the entry API example, as the `&'static str` doesn't add value here, and the entry API isn't actually very useful when you have non-Copy owned keys (like `String`) because you are forced to heap-allocate the String even if the key already exists.
miguelraz pushed a commit that referenced this pull request Dec 24, 2024
Simplify the entry API example, as the `&'static str` doesn't add value here, and the entry API isn't actually very useful when you have non-Copy owned keys (like `String`) because you are forced to heap-allocate the String even if the key already exists.
miguelraz pushed a commit that referenced this pull request Jan 13, 2025
Simplify the entry API example, as the `&'static str` doesn't add value here, and the entry API isn't actually very useful when you have non-Copy owned keys (like `String`) because you are forced to heap-allocate the String even if the key already exists.
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.

3 participants