5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-03 01:18:02 +03:00

backup_manager: use Vec::first instead of get(0)

Fixes the get_first clippy lint:

```
warning: accessing first element with `matching_stores.get(0)`
   --> src/bin/proxmox_backup_manager/datastore.rs:284:26
    |
284 |     if let Some(store) = matching_stores.get(0) {
    |                          ^^^^^^^^^^^^^^^^^^^^^^ help: try: `matching_stores.first()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
    = note: `#[warn(clippy::get_first)]` on by default
```

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
Maximiliano Sandoval 2024-12-02 10:57:58 +01:00 committed by Fabian Grünbichler
parent 81635877e2
commit de44cb7b47

View File

@ -281,7 +281,7 @@ async fn uuid_mount(param: Value, _rpcenv: &mut dyn RpcEnvironment) -> Result<Va
return Ok(Value::Null);
}
if let Some(store) = matching_stores.get(0) {
if let Some(store) = matching_stores.first() {
api2::admin::datastore::do_mount_device(store.clone())?;
}