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

Make StatusCode::as_str return &'static str #466

Closed
wants to merge 1 commit into from
Closed

Make StatusCode::as_str return &'static str #466

wants to merge 1 commit into from

Conversation

RAnders00
Copy link

@RAnders00 RAnders00 commented Feb 27, 2021

The lifetime of the returned &str was implicitly pub fn as_str<'a>(&'a self) -> &'a str. This changes that to pub fn as_str<'a>(&'a self) -> &'static str. This would allow me to use the returned &str in my project without having to clone it into an owned String first.

@dekellum

This comment has been minimized.

@seanmonstar
Copy link
Member

Yea, this is a dupe. For reference, I've just started an issue (#468) to try to collect thoughts on the decision to make regarding this method.

@dekellum
Copy link
Contributor

dekellum commented Mar 3, 2021

Dup of #452 (for the record).

@RAnders00 RAnders00 closed this Mar 6, 2021
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.

None yet

3 participants