diff --git a/pbs-tape/src/lib.rs b/pbs-tape/src/lib.rs index 1de2bc54..8d408b70 100644 --- a/pbs-tape/src/lib.rs +++ b/pbs-tape/src/lib.rs @@ -281,7 +281,7 @@ impl MtxStatus { // (are there changers exposing more than one?) // defaults to 0 for changer that do not report transports self.transports - .get(0) + .first() .map(|t| t.element_address) .unwrap_or(0u16) } diff --git a/pbs-tape/src/sg_pt_changer.rs b/pbs-tape/src/sg_pt_changer.rs index 5b8596f0..3945d18f 100644 --- a/pbs-tape/src/sg_pt_changer.rs +++ b/pbs-tape/src/sg_pt_changer.rs @@ -850,7 +850,7 @@ mod test { .map(|desc| build_storage_descriptor(desc, trailing)) .collect(); - let (desc_len, address) = if let Some(el) = descs.get(0) { + let (desc_len, address) = if let Some(el) = descs.first() { (el.len() as u16, descriptors[0].address) } else { (0u16, 0u16) diff --git a/src/server/realm_sync_job.rs b/src/server/realm_sync_job.rs index 9094c2fa..158c2c37 100644 --- a/src/server/realm_sync_job.rs +++ b/src/server/realm_sync_job.rs @@ -170,7 +170,7 @@ impl LdapRealmSyncJob { "userid attribute `{user_id_attribute}` not in LDAP search result" ) })? - .get(0) + .first() .context("userid attribute array is empty")? .clone(); @@ -233,7 +233,7 @@ impl LdapRealmSyncJob { existing_user: Option<&User>, ) -> User { let lookup = |attribute: &str, ldap_attribute: Option<&String>, schema: &'static Schema| { - let value = result.attributes.get(ldap_attribute?)?.get(0)?; + let value = result.attributes.get(ldap_attribute?)?.first()?; let schema = schema.unwrap_string_schema(); if let Err(e) = schema.check_constraints(value) {