Commit Graph

2654 Commits

Author SHA1 Message Date
Maximiliano Sandoval
baccbda477 acme: elide explicit lifetimes
Fixes the clippy warning:

warning: the following explicit lifetimes could be elided: 'a
  --> proxmox-acme/src/async_client.rs:65:30
   |
65 |     pub async fn new_account<'a>(
   |                              ^^
66 |         &'a mut self,
   |          ^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
   = note: `#[warn(clippy::needless_lifetimes)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
6b1e4b83bb http: remove unnecessary cast
Fixes the clippy warning:

warning: casting to the same type is unnecessary (`usize` -> `usize`)
   --> proxmox-http/src/websocket/mod.rs:446:40
    |
446 |             mask.copy_from_slice(&data[mask_offset as usize..payload_offset as usize]);
    |                                        ^^^^^^^^^^^^^^^^^^^^ help: try: `mask_offset`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    = note: `#[warn(clippy::unnecessary_cast)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
b006e66361 http: remove redundant redefinition of binding
Fixes the clippy error:

error: redundant redefinition of a binding `data`
   --> proxmox-http/src/websocket/mod.rs:375:9
    |
375 |         let data = data;
    |         ^^^^^^^^^^^^^^^^
    |
help: `data` is initially defined here
   --> proxmox-http/src/websocket/mod.rs:369:27
    |
369 |     pub fn try_from_bytes(data: &[u8]) -> Result<Option<FrameHeader>, WebSocketError> {
    |                           ^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals
    = note: `#[deny(clippy::redundant_locals)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
82bc4db723 network-api: remove useless uses of format!
Fixes the clippy warning:

warning: useless use of `format!`
   --> proxmox-network-api/src/config/mod.rs:632:13
    |
632 | /             format!(
633 | |                 r#"
634 | | iface enp3s0 inet static
635 | |     address 10.0.0.100/16
636 | |     gateway 10.0.0.1"#
637 | |             )
    | |_____________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
help: consider using `.to_string()`
    |
632 ~             r#"
633 + iface enp3s0 inet static
634 ~     address 10.0.0.100/16
635 ~     gateway 10.0.0.1"#.to_string()

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
d965713565 shared-memory: remove unneeded generic parameter
Fixes the clippy warning:

warning: type parameter `T` goes unused in function definition
  --> proxmox-shared-memory/tests/raw_shared_mutex.rs:80:19
   |
80 | fn create_test_dir<T: Init>(filename: &str) -> Option<PathBuf> {
   |                   ^^^^^^^^^ help: consider removing the parameter
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_type_parameters
   = note: `#[warn(clippy::extra_unused_type_parameters)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
a87d52dad3 remove unneeded returns
Fixes the clippy warning:

warning: unneeded `return` statement
   --> proxmox-tfa/src/api/mod.rs:468:17
    |
468 | /                 return TfaResult::Failure {
469 | |                     needs_saving: true,
470 | |                     tfa_limit_reached,
471 | |                     totp_limit_reached,
472 | |                 };
    | |_________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
    |
468 ~                 TfaResult::Failure {
469 +                     needs_saving: true,
470 +                     tfa_limit_reached,
471 +                     totp_limit_reached,
472 ~                 }
    |

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
d07a0243f4 use const blocks in thread_local! calls
Fixes the clippy warning:

warning: initializer for `thread_local` value can be made `const`
   --> proxmox-router/src/cli/command.rs:221:71
    |
221 |     static HELP_CONTEXT: RefCell<Option<Arc<CommandLineInterface>>> = RefCell::new(None);
    |                                                                       ^^^^^^^^^^^^^^^^^^ help: replace with: `const { RefCell::new(None) }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#thread_local_initializer_can_be_made_const
    = note: `#[warn(clippy::thread_local_initializer_can_be_made_const)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
e3602c1943 acl: remove null pointer cast
Fixes the clippy warning:

warning: casting raw pointers to the same type and constness is unnecessary (`*mut fs::acl::libc::c_void` -> `*mut fs::acl::libc::c_void`)
   --> proxmox-sys/src/fs/acl.rs:130:23
    |
130 |         let mut ptr = ptr::null_mut() as *mut c_void;
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ptr::null_mut()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    = note: `#[warn(clippy::unnecessary_cast)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
30461d091c acme: remove duplicated attribute
Fixes the following clippy warning:

warning: duplicated attribute
  --> proxmox-acme/src/lib.rs:42:7
   |
42 | #[cfg(feature = "impl")]
   |       ^^^^^^^^^^^^^^^^
   |
note: first defined here
  --> proxmox-acme/src/lib.rs:41:7
   |
41 | #[cfg(feature = "impl")]
   |       ^^^^^^^^^^^^^^^^
help: remove this attribute
  --> proxmox-acme/src/lib.rs:42:7
   |
42 | #[cfg(feature = "impl")]
   |       ^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#duplicated_attributes
   = note: `#[warn(clippy::duplicated_attributes)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
bf68d540b8 time-api: remove redundant field names
Fixes the clippy warning:

warning: redundant field names in struct initialization
  --> proxmox-time-api/src/time_impl.rs:53:9
   |
53 |         localtime: localtime,
   |         ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `localtime`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
18dda8106b remove unnecesary pub(self)
Fixes the clippy warning:

warning: unnecessary `pub(self)`
    --> proxmox-tfa/src/api/mod.rs:1268:1
     |
1268 | pub(self) fn bool_is_false(v: &bool) -> bool {
     | ^^^^^^^^^ help: remove it
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pub_self

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
aff76f9e0e remove needless borrows
Fixes the following clippy warnings:

warning: the borrowed expression implements the required traits
  --> proxmox-tfa/src/api/recovery.rs:86:24
   |
86 |         Ok(hex::encode(&hmac))
   |                        ^^^^^ help: change this to: `hmac`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args

and

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> proxmox-network-api/src/api_impl.rs:108:47
    |
108 |                 interface.set_bond_slave_list(&slaves)?;
    |                                               ^^^^^^^ help: change this to: `slaves`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
    = note: `#[warn(clippy::needless_borrow)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
cb4acf6d93 use contains_key instead of .get().is_{some, none}()
Fixes the clippy lints:

warning: unnecessary use of `get("lo").is_none()`
   --> proxmox-network-api/src/config/parser.rs:603:30
    |
603 |         if config.interfaces.get("lo").is_none() {
    |            ------------------^^^^^^^^^^^^^^^^^^^
    |            |
    |            help: replace it with: `!config.interfaces.contains_key("lo")`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check
    = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Maximiliano Sandoval
16aa2b74bc use unwrap_or_default instead of unwrap_or(Vec::new)
Fixes the clippy warning:

warning: use of `unwrap_or_else` to construct default value
    --> proxmox-tfa/src/api/mod.rs:1355:43
     |
1355 |         |cap| cap.map(Vec::with_capacity).unwrap_or_else(Vec::new),
     |                                           ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
     = note: `#[warn(clippy::unwrap_or_default)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-06-28 10:22:58 +02:00
Fabian Grünbichler
8c9eb85706 ldap: fix Cargo.toml syntax
this throws a warning now..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-25 13:54:26 +02:00
Fabian Grünbichler
af353659c8 run cargo fmt
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-24 10:02:31 +02:00
Fabian Grünbichler
1ba198265c trivial clippy fix
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-24 10:01:13 +02:00
Wolfgang Bumiller
3663ae8255 async: bump to 0.4.2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 14:30:10 +02:00
Wolfgang Bumiller
0e17606caf rest-server: bump to 0.5.3-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 14:06:12 +02:00
Wolfgang Bumiller
51680ea77e openid: bump to 0.10.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 14:04:41 +02:00
Wolfgang Bumiller
0a0d8a4d73 notify: bump to 0.4.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 14:02:10 +02:00
Wolfgang Bumiller
eededbeb93 dns-api: bump to 0.1.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 14:00:49 +02:00
Wolfgang Bumiller
eca6f31a22 compression: bump to 0.2.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:59:46 +02:00
Wolfgang Bumiller
80baf82df2 tfa: bump to 4.1.3
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:58:55 +02:00
Wolfgang Bumiller
f1a5583932 acme-api: bump to 0.1.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:57:53 +02:00
Wolfgang Bumiller
2f77909a6d access-control: bump to 0.1.1-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:56:31 +02:00
Wolfgang Bumiller
19200f7415 rrd: bump to 0.2.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:56:06 +02:00
Wolfgang Bumiller
54bc3abdfd subscription: bump to 0.4.4-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:55:39 +02:00
Wolfgang Bumiller
821fdb63b0 serde: bump to 0.1.2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:55:39 +02:00
Wolfgang Bumiller
3cd7223cc1 sys: bump to 0.5.8-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:55:39 +02:00
Wolfgang Bumiller
ab41b5ce43 time-api: bump to 0.1.2-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:49:56 +02:00
Wolfgang Bumiller
bb8460bc0f time: bump to 2.0.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:49:56 +02:00
Wolfgang Bumiller
214dbdf9a5 time: remove deprecated functions
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:48:42 +02:00
Wolfgang Bumiller
533954ed38 bump bitflags dependency to 2.4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 13:48:32 +02:00
Fabian Grünbichler
c96ad06247 move .cargo/config to .cargo/config.toml
the old location has been deprecated for a while, and rustc 1.78 will start to warn about it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-20 12:29:30 +02:00
Wolfgang Bumiller
0f33d603ef router: bump to 2.1.5-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 10:56:05 +02:00
Wolfgang Bumiller
57fb1004b8 sys: bump to 0.5.7-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 10:56:05 +02:00
Wolfgang Bumiller
d8eb6d1bde lang: bump to 1.3.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 10:56:05 +02:00
Wolfgang Bumiller
b16922860a sys: make xattr CStrs constants, repalce c_str! macro
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 10:56:05 +02:00
Wolfgang Bumiller
0233c8c63b router: repalce c_str! with c"literals"
we can now drop the proxmox-lang dependency here

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 10:55:10 +02:00
Wolfgang Bumiller
38992a588a lang: deprecate c_str! and offsetof
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 10:55:10 +02:00
Wolfgang Bumiller
2e9526dcdd tfa: fix a compile warning
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 10:55:10 +02:00
Fabian Grünbichler
937d985489 build: adapt workspace member command
to work with cargo 1.77

Originally-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-19 16:04:35 +02:00
Wolfgang Bumiller
1c5f27014c time: drop TryFrom/TryInto imports
they're in the prelude by now

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-19 14:55:41 +02:00
Shannon Sterz
a4be52d4a6 time: exclude certain use statements and impl block on wasm32
otherwise the compiler will complain that they aren't used when
compiling the code for wasm32.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-06-19 14:55:41 +02:00
Wolfgang Bumiller
c547ea07ae access-control: bump to 0.1.0-1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-19 14:45:52 +02:00
Wolfgang Bumiller
4197c0e26e access-control: minor code cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-19 14:42:43 +02:00
Wolfgang Bumiller
5daf898b14 access-control: cleanup comment in Cargo.toml
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-19 14:42:43 +02:00
Shannon Sterz
46d8423d72 access-control: split crate in default and impl features
this way the types defined in this crate can be re-used in places
without necessarily having to use the ACL, token shadow and
(cached) user config implementations.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-06-19 14:42:43 +02:00
Shannon Sterz
1dc88b5e3c access-control: move to flatten User into UserWithToken
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2024-06-19 14:42:41 +02:00