The following code produces a warning when compiled:
pub fn add_source_path(request: &mut Request) -> IronResult<Response> {
/// Adds source path to the database.
///
/// This function saves provided absolute path (on the server) to the database
/// and goes over all jpeg files recursively in order to add them to DB.
let params = request.get_ref::<Params>().unwrap();
let path = ¶ms["path"];
This is the warning:
warning: doc comment not used by rustdoc
--> src/crawler.rs:64:2
|
64 | /// Adds source path to the database.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_doc_comment)] on by default
What exactly does this warning mean and how to fix it?
Comments starting with ///
are used to generate documentation. Those documentation comments go before the function they document. Quoting The Rust Programming Language:
Place documentation comments just before the item they’re documenting.
/// Adds source path to the database.
///
/// This function saves provided absolute path (on the server) to the database
/// and goes over all jpeg files recursively in order to add them to DB.
pub fn add_source_path(request: &mut Request) -> IronResult<Response> {
// ...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With