mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-09 10:56:20 +00:00
💄 Reduce indentation in Database::rejoin_room
This commit is contained in:
parent
cb8962691a
commit
6a2066af6c
1 changed files with 178 additions and 180 deletions
|
@ -1376,8 +1376,9 @@ impl Database {
|
|||
.exec(&*tx)
|
||||
.await?;
|
||||
if participant_update.rows_affected == 0 {
|
||||
Err(anyhow!("room does not exist or was already joined"))?
|
||||
} else {
|
||||
return Err(anyhow!("room does not exist or was already joined"))?;
|
||||
}
|
||||
|
||||
let mut reshared_projects = Vec::new();
|
||||
for reshared_project in &rejoin_room.reshared_projects {
|
||||
let project_id = ProjectId::from_proto(reshared_project.project_id);
|
||||
|
@ -1413,9 +1414,7 @@ impl Database {
|
|||
.await?;
|
||||
project_collaborator::Entity::update(project_collaborator::ActiveModel {
|
||||
connection_id: ActiveValue::set(connection.id as i32),
|
||||
connection_server_id: ActiveValue::set(ServerId(
|
||||
connection.owner_id as i32,
|
||||
)),
|
||||
connection_server_id: ActiveValue::set(ServerId(connection.owner_id as i32)),
|
||||
..host.into_active_model()
|
||||
})
|
||||
.exec(&*tx)
|
||||
|
@ -1574,7 +1573,6 @@ impl Database {
|
|||
reshared_projects,
|
||||
},
|
||||
))
|
||||
}
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue