[pbs-devel] [PATCH backup 1/2] restore-daemon: Module docs should use //! rather than ///!

Maximiliano Sandoval m.sandoval at proxmox.com
Wed Feb 14 10:04:47 CET 2024


Otherwise they apply to the next item only. The example in the link
of the following clippy lint:

```
warning: this is an outer doc comment and does not apply to the parent module or crate
 --> proxmox-restore-daemon/src/proxmox_restore_daemon/api.rs:1:1
  |
1 | ///! File-restore API running inside the restore VM
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_doc_comments
help: use an inner doc comment to document the parent module or crate
  |
1 | //! File-restore API running inside the restore VM
```

suggests that

```
pub mod foo {
    ///! This docstring is attached to `bar` rather than `foo`.

    pub fn bar() {}
}
```

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 proxmox-restore-daemon/src/main.rs                       | 2 +-
 proxmox-restore-daemon/src/proxmox_restore_daemon/api.rs | 2 +-
 proxmox-restore-daemon/src/proxmox_restore_daemon/mod.rs | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/proxmox-restore-daemon/src/main.rs b/proxmox-restore-daemon/src/main.rs
index f94b6c67..f9df2705 100644
--- a/proxmox-restore-daemon/src/main.rs
+++ b/proxmox-restore-daemon/src/main.rs
@@ -1,4 +1,4 @@
-///! Daemon binary to run inside a micro-VM for secure single file restore of disk images
+//! Daemon binary to run inside a micro-VM for secure single file restore of disk images
 use std::fs::File;
 use std::io::prelude::*;
 use std::os::unix::{
diff --git a/proxmox-restore-daemon/src/proxmox_restore_daemon/api.rs b/proxmox-restore-daemon/src/proxmox_restore_daemon/api.rs
index c4e97d33..f2a0cdab 100644
--- a/proxmox-restore-daemon/src/proxmox_restore_daemon/api.rs
+++ b/proxmox-restore-daemon/src/proxmox_restore_daemon/api.rs
@@ -1,4 +1,4 @@
-///! File-restore API running inside the restore VM
+//! File-restore API running inside the restore VM
 use std::ffi::OsStr;
 use std::fs;
 use std::os::unix::ffi::OsStrExt;
diff --git a/proxmox-restore-daemon/src/proxmox_restore_daemon/mod.rs b/proxmox-restore-daemon/src/proxmox_restore_daemon/mod.rs
index 58e2bb6e..d50c3287 100644
--- a/proxmox-restore-daemon/src/proxmox_restore_daemon/mod.rs
+++ b/proxmox-restore-daemon/src/proxmox_restore_daemon/mod.rs
@@ -1,4 +1,4 @@
-///! File restore VM related functionality
+//! File restore VM related functionality
 mod api;
 pub use api::*;
 
-- 
2.39.2





More information about the pbs-devel mailing list