Example on rocket.rs homepage miscategorizes a &'static str
as a String
#2921
Labels
docs
Improvements or additions to documentation
&'static str
as a String
#2921
What kind of documentation problem are you reporting?
Technical Problem
Where is the issue found?
https://rocket.rs/#routing-panel
What's wrong?
For the "Ins and Outs" / "Routing" panel, it provides an example where the
index
function has a signature showing that it returns a string of type&'static str
, however, in the text immediately below the example, it says "The handler returns aString
.", which is a different type under the Rust ownership system.The simplest solution to this issue would be to change the text to instead read as "The handler returns a
&'static str
."On the other hand, if we were to prefer for the example to actually return an owned
String
instead, then we must update the example code to reflect it, perhaps with something like this:System Checks
master
on GitHub.The text was updated successfully, but these errors were encountered: