Skip to content

Conversation

@Joshix-1
Copy link

@Joshix-1 Joshix-1 commented Sep 3, 2025

This allows users to convert it to the same String has before using .to_string() But for users using format! this could save a heap allocation.

This allows users to convert it to the same String has before using .to_string()
But for users using format! this could save a heap allocation.
@github-actions github-actions bot added the model Related to the `model` module. label Sep 3, 2025
@arqunis arqunis added enhancement An improvement to Serenity. breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users labels Oct 6, 2025
@arqunis arqunis merged commit 756ddf4 into serenity-rs:next Oct 6, 2025
24 checks passed
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Oct 7, 2025
…matting the link (serenity-rs#3415)

Users can still convert it to a `String` using `ToString::to_string`, but if they happen to pass it to a formatting macro such as `format!`, they will avoid a heap allocation that would have otherwise occurred for the link, which is the motivation for this change.
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Oct 7, 2025
…matting the link (serenity-rs#3415)

Users can still convert it to a `String` using `ToString::to_string`, but if they happen to pass it to a formatting macro such as `format!`, they will avoid a heap allocation that would have otherwise occurred for the link, which is the motivation for this change.
mkrasnitski pushed a commit to mkrasnitski/serenity that referenced this pull request Oct 7, 2025
…matting the link (serenity-rs#3415)

Users can still convert it to a `String` using `ToString::to_string`, but if they happen to pass it to a formatting macro such as `format!`, they will avoid a heap allocation that would have otherwise occurred for the link, which is the motivation for this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change The public API is changed, resulting in miscompilations or unexpected new behaviour for users enhancement An improvement to Serenity. model Related to the `model` module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants