Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsp committed Oct 10, 2023
1 parent b36abf8 commit f995935
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions pageserver/src/tenant/mgr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,13 +1050,10 @@ pub(crate) async fn attach_tenant(
) -> Result<(), TenantMapInsertError> {
let mut tenant_guard = tenant_map_acquire_slot(&tenant_id, None)?;

match tenant_guard.take_value() {
Some(TenantSlot::Attached(t)) => {
return Err(TenantMapInsertError::SlotError(
TenantSlotError::AlreadyExists(tenant_id, t.current_state()),
));
}
_ => {}
if let Some(TenantSlot::Attached(t)) = tenant_guard.take_value() {
return Err(TenantMapInsertError::SlotError(
TenantSlotError::AlreadyExists(tenant_id, t.current_state()),
));
}

let location_conf = LocationConf::attached_single(tenant_conf, generation);
Expand Down Expand Up @@ -1317,9 +1314,8 @@ fn tenant_map_acquire_slot_impl(
let entry = m.entry(*tenant_id);
match entry {
Entry::Vacant(v) => {
match expect_exist {
Some(true) => return Err(TenantSlotError::NotFound(*tenant_id)),
_ => {}
if let Some(true) = expect_exist {
return Err(TenantSlotError::NotFound(*tenant_id));
}

let notify = Arc::new(tokio::sync::Notify::new());
Expand Down

0 comments on commit f995935

Please sign in to comment.