Skip to content

add as_str method for Warning and Suggestion - #90

Open
veeshi wants to merge 2 commits into
shssoichiro:masterfrom
hisn-io:as-str
Open

add as_str method for Warning and Suggestion#90
veeshi wants to merge 2 commits into
shssoichiro:masterfrom
hisn-io:as-str

Conversation

@veeshi

@veeshi veeshi commented Oct 22, 2025

Copy link
Copy Markdown

No description provided.

@shssoichiro

Copy link
Copy Markdown
Owner

These methods are redundant. These structs already have Display implemented, which gives them the .to_string() method. You should use that existing method in your code instead.

@veeshi

veeshi commented Oct 30, 2025

Copy link
Copy Markdown
Author

The purpose was to use in places where we don't want to allocate and need static string slices.

@shssoichiro

Copy link
Copy Markdown
Owner

In that case, the idea seems fine, but this will need to be refactored so we aren't duplicating all of the string definitions. We can have Display call as_str() instead.

@shssoichiro shssoichiro reopened this Oct 30, 2025

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Comment thread src/feedback.rs
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