Skip to content

Thoughts on updating documentation/examples #1156

@jkaye2012

Description

@jkaye2012

Thanks for the fantastic library!

I have been reading through documentation and examples to learn about Rocket. One thing that confused me is the use of macro_use, extern crate, and serde_derive, none of which I believe are necessary any more (or at least they do not appear to be in my testing). For example, the tera_template example currently begins with:

#[macro_use] extern crate rocket;
#[macro_use] extern crate serde_derive;

But I am able to serve templates through routes with:

use rocket::{get, routes};
use rocket_contrib::templates::Template;
use serde::Serialize;

Of course, I have the serde "derive" feature enabled.

I also noticed another line in the doc that seems to perhaps not be currently, namely that #![feature(proc_macro_hygiene, decl_macro)] must be in the crate entrypoint; I have it instead in a library module and things are working well.

I would be happy to submit a pull request containing this kind of update, but wanted to get some feedback on all of this first. Maybe there's some reason that I'm unaware of that the currently documented way is preferred? I'm relatively new to Rust, so it's hard for me to know.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedAn accepted request or suggestiondocsImprovements or additions to documentationsuggestionA suggestion to change functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions