* [pbs-devel] [PATCH backup 1/3] docs: remove empty lines in doc strings
@ 2024-12-02 13:10 Maximiliano Sandoval
2024-12-02 13:10 ` [pbs-devel] [PATCH backup 2/3] chunker: do not reassign context's total field Maximiliano Sandoval
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2024-12-02 13:10 UTC (permalink / raw)
To: pbs-devel
Fixes the clippy lint:
```
warning: empty line after doc comment
--> src/tape/pool_writer/mod.rs:441:5
|
441 | / /// updated.
442 | |
| |_
...
448 | / pub fn append_snapshot_archive(
449 | | &mut self,
450 | | snapshot_reader: &SnapshotReader,
451 | | ) -> Result<(bool, usize), Error> {
| |_____________________________________- the comment documents this method
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
= help: if the empty line is unintentional remove it
help: if the documentation should include the empty line include it in the comment
|
442 | ///
|
```
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
pbs-client/src/catalog_shell.rs | 1 -
pbs-datastore/src/chunker.rs | 1 -
src/tape/pool_writer/mod.rs | 4 ++--
3 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/pbs-client/src/catalog_shell.rs b/pbs-client/src/catalog_shell.rs
index 550daf56b..20f323a22 100644
--- a/pbs-client/src/catalog_shell.rs
+++ b/pbs-client/src/catalog_shell.rs
@@ -303,7 +303,6 @@ async fn restore_command(target: String, pattern: Option<String>) -> Result<(),
/// The `Path` type's component iterator does not tell us anything about trailing slashes or
/// trailing `Component::CurDir` entries. Since we only support regular paths we'll roll our own
/// here:
-
pub struct Shell {
/// Readline instance handling input and callbacks
rl: rustyline::Editor<CliHelper>,
diff --git a/pbs-datastore/src/chunker.rs b/pbs-datastore/src/chunker.rs
index ecdbca296..bf1e8d8df 100644
--- a/pbs-datastore/src/chunker.rs
+++ b/pbs-datastore/src/chunker.rs
@@ -30,7 +30,6 @@ pub trait Chunker {
/// information please take a look at the [Rolling
/// Hash](https://en.wikipedia.org/wiki/Rolling_hash) article from
/// Wikipedia.
-
pub struct ChunkerImpl {
h: u32,
window_size: usize,
diff --git a/src/tape/pool_writer/mod.rs b/src/tape/pool_writer/mod.rs
index 9731e1cc8..3114ec061 100644
--- a/src/tape/pool_writer/mod.rs
+++ b/src/tape/pool_writer/mod.rs
@@ -332,7 +332,7 @@ impl PoolWriter {
/// Move to EOM (if not already there), then write the current
/// catalog to the tape. On success, this return 'Ok(true)'.
-
+ ///
/// Please note that this may fail when there is not enough space
/// on the media (return value 'Ok(false, _)'). In that case, the
/// archive is marked incomplete. The caller should mark the media
@@ -439,7 +439,7 @@ impl PoolWriter {
/// archive writing specified files (as .pxar) into it. On
/// success, this return 'Ok(true)' and the media catalog gets
/// updated.
-
+ ///
/// Please note that this may fail when there is not enough space
/// on the media (return value 'Ok(false, _)'). In that case, the
/// archive is marked incomplete, and we do not use it. The caller
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pbs-devel] [PATCH backup 2/3] chunker: do not reassign context's total field
2024-12-02 13:10 [pbs-devel] [PATCH backup 1/3] docs: remove empty lines in doc strings Maximiliano Sandoval
@ 2024-12-02 13:10 ` Maximiliano Sandoval
2024-12-02 13:10 ` [pbs-devel] [PATCH backup 3/3] client: clippy: allow too_many_arguments Maximiliano Sandoval
2024-12-03 10:26 ` [pbs-devel] applied-series: [PATCH backup 1/3] docs: remove empty lines in doc strings Fabian Grünbichler
2 siblings, 0 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2024-12-02 13:10 UTC (permalink / raw)
To: pbs-devel
```
warning: field assignment outside of initializer for an instance created with Default::default()
--> pbs-datastore/src/chunker.rs:431:5
|
431 | ctx.total = buffer.len() as u64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider initializing the variable with `chunker::Context { total: buffer.len() as u64, ..Default::default() }` and removing relevant reassignments
--> pbs-datastore/src/chunker.rs:430:5
|
430 | let mut ctx = Context::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
= note: `#[warn(clippy::field_reassign_with_default)]` on by default
```
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
pbs-datastore/src/chunker.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pbs-datastore/src/chunker.rs b/pbs-datastore/src/chunker.rs
index bf1e8d8df..f6892e086 100644
--- a/pbs-datastore/src/chunker.rs
+++ b/pbs-datastore/src/chunker.rs
@@ -427,8 +427,10 @@ fn test_suggested_boundary() {
chunks1.push((last, buffer.len() - last));
let mut pos = 0;
- let mut ctx = Context::default();
- ctx.total = buffer.len() as u64;
+ let mut ctx = Context {
+ total: buffer.len() as u64,
+ ..Default::default()
+ };
chunker.reset();
// Suggest chunk boundary within regular chunk
tx.send(32 * 1024).unwrap();
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pbs-devel] [PATCH backup 3/3] client: clippy: allow too_many_arguments
2024-12-02 13:10 [pbs-devel] [PATCH backup 1/3] docs: remove empty lines in doc strings Maximiliano Sandoval
2024-12-02 13:10 ` [pbs-devel] [PATCH backup 2/3] chunker: do not reassign context's total field Maximiliano Sandoval
@ 2024-12-02 13:10 ` Maximiliano Sandoval
2024-12-03 10:26 ` [pbs-devel] applied-series: [PATCH backup 1/3] docs: remove empty lines in doc strings Fabian Grünbichler
2 siblings, 0 replies; 4+ messages in thread
From: Maximiliano Sandoval @ 2024-12-02 13:10 UTC (permalink / raw)
To: pbs-devel
These are API endpoints.
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
proxmox-backup-client/src/main.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/proxmox-backup-client/src/main.rs b/proxmox-backup-client/src/main.rs
index b0d45f89e..9daa513f9 100644
--- a/proxmox-backup-client/src/main.rs
+++ b/proxmox-backup-client/src/main.rs
@@ -736,6 +736,7 @@ fn spawn_catalog_upload(
}
)]
/// Create (host) backup.
+#[allow(clippy::too_many_arguments)]
async fn create_backup(
param: Value,
all_file_systems: bool,
@@ -1490,6 +1491,7 @@ We do not extract '.pxar' archives when writing to standard output.
}
)]
/// Restore backup repository.
+#[allow(clippy::too_many_arguments)]
async fn restore(
param: Value,
allow_existing_dirs: bool,
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* [pbs-devel] applied-series: [PATCH backup 1/3] docs: remove empty lines in doc strings
2024-12-02 13:10 [pbs-devel] [PATCH backup 1/3] docs: remove empty lines in doc strings Maximiliano Sandoval
2024-12-02 13:10 ` [pbs-devel] [PATCH backup 2/3] chunker: do not reassign context's total field Maximiliano Sandoval
2024-12-02 13:10 ` [pbs-devel] [PATCH backup 3/3] client: clippy: allow too_many_arguments Maximiliano Sandoval
@ 2024-12-03 10:26 ` Fabian Grünbichler
2 siblings, 0 replies; 4+ messages in thread
From: Fabian Grünbichler @ 2024-12-03 10:26 UTC (permalink / raw)
To: Proxmox Backup Server development discussion
thanks!
On December 2, 2024 2:10 pm, Maximiliano Sandoval wrote:
> Fixes the clippy lint:
>
> ```
> warning: empty line after doc comment
> --> src/tape/pool_writer/mod.rs:441:5
> |
> 441 | / /// updated.
> 442 | |
> | |_
> ...
> 448 | / pub fn append_snapshot_archive(
> 449 | | &mut self,
> 450 | | snapshot_reader: &SnapshotReader,
> 451 | | ) -> Result<(bool, usize), Error> {
> | |_____________________________________- the comment documents this method
> |
> = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
> = help: if the empty line is unintentional remove it
> help: if the documentation should include the empty line include it in the comment
> |
> 442 | ///
> |
> ```
>
> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
> ---
> pbs-client/src/catalog_shell.rs | 1 -
> pbs-datastore/src/chunker.rs | 1 -
> src/tape/pool_writer/mod.rs | 4 ++--
> 3 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/pbs-client/src/catalog_shell.rs b/pbs-client/src/catalog_shell.rs
> index 550daf56b..20f323a22 100644
> --- a/pbs-client/src/catalog_shell.rs
> +++ b/pbs-client/src/catalog_shell.rs
> @@ -303,7 +303,6 @@ async fn restore_command(target: String, pattern: Option<String>) -> Result<(),
> /// The `Path` type's component iterator does not tell us anything about trailing slashes or
> /// trailing `Component::CurDir` entries. Since we only support regular paths we'll roll our own
> /// here:
> -
> pub struct Shell {
> /// Readline instance handling input and callbacks
> rl: rustyline::Editor<CliHelper>,
> diff --git a/pbs-datastore/src/chunker.rs b/pbs-datastore/src/chunker.rs
> index ecdbca296..bf1e8d8df 100644
> --- a/pbs-datastore/src/chunker.rs
> +++ b/pbs-datastore/src/chunker.rs
> @@ -30,7 +30,6 @@ pub trait Chunker {
> /// information please take a look at the [Rolling
> /// Hash](https://en.wikipedia.org/wiki/Rolling_hash) article from
> /// Wikipedia.
> -
> pub struct ChunkerImpl {
> h: u32,
> window_size: usize,
> diff --git a/src/tape/pool_writer/mod.rs b/src/tape/pool_writer/mod.rs
> index 9731e1cc8..3114ec061 100644
> --- a/src/tape/pool_writer/mod.rs
> +++ b/src/tape/pool_writer/mod.rs
> @@ -332,7 +332,7 @@ impl PoolWriter {
>
> /// Move to EOM (if not already there), then write the current
> /// catalog to the tape. On success, this return 'Ok(true)'.
> -
> + ///
> /// Please note that this may fail when there is not enough space
> /// on the media (return value 'Ok(false, _)'). In that case, the
> /// archive is marked incomplete. The caller should mark the media
> @@ -439,7 +439,7 @@ impl PoolWriter {
> /// archive writing specified files (as .pxar) into it. On
> /// success, this return 'Ok(true)' and the media catalog gets
> /// updated.
> -
> + ///
> /// Please note that this may fail when there is not enough space
> /// on the media (return value 'Ok(false, _)'). In that case, the
> /// archive is marked incomplete, and we do not use it. The caller
> --
> 2.39.5
>
>
>
> _______________________________________________
> pbs-devel mailing list
> pbs-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
>
>
>
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-12-03 10:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-02 13:10 [pbs-devel] [PATCH backup 1/3] docs: remove empty lines in doc strings Maximiliano Sandoval
2024-12-02 13:10 ` [pbs-devel] [PATCH backup 2/3] chunker: do not reassign context's total field Maximiliano Sandoval
2024-12-02 13:10 ` [pbs-devel] [PATCH backup 3/3] client: clippy: allow too_many_arguments Maximiliano Sandoval
2024-12-03 10:26 ` [pbs-devel] applied-series: [PATCH backup 1/3] docs: remove empty lines in doc strings Fabian Grünbichler
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal