Open
Description
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 a String
.", 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:
#[get("/")]
fn index() -> String {
"Hello, world!".to_string()
}
System Checks
- I confirmed that the issue still exists on
master
on GitHub. - I was unable to find a previous report of this problem.