Skip to content

Experimenting on 09_strings/strings1.rs #2184

Closed Answered by mo8it
neerajnangiredddy asked this question in Q&A
Discussion options

You must be logged in to vote

String literals like "blue" have the type &str. You can think of them as being borrowed from a fixed space in memory, but they are valid until the program terminates. You need to change the return type to &str.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mo8it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants