chore: cargo clippy
This commit is contained in:
parent
22a416c99f
commit
42b98aeb77
|
|
@ -701,21 +701,15 @@ impl PublishCollabDuplicator {
|
|||
}
|
||||
}
|
||||
for m in type_option_values {
|
||||
if let Some(db_id) = m.get(&txn, "database_id") {
|
||||
if let Out::Any(a) = db_id {
|
||||
if let any::Any::String(s) = a {
|
||||
if let Some(Out::Any(any::Any::String(s))) = m.get(&txn, "database_id") {
|
||||
if let Some(related_db_view) = published_db.database_relations.get(s.as_ref()) {
|
||||
if let Some(dup_view_id) =
|
||||
self.deep_copy_view(related_db_view, &new_view_id).await?
|
||||
{
|
||||
if let Some(dup_view_id) = self.deep_copy_view(related_db_view, &new_view_id).await? {
|
||||
m.insert(&mut txn, "database_id", dup_view_id);
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// duplicate db collab rows
|
||||
for (old_id, row_bin_data) in &published_db.database_row_collabs {
|
||||
|
|
@ -748,9 +742,7 @@ impl PublishCollabDuplicator {
|
|||
let mut rel_row_idss = vec![];
|
||||
for (_, out) in cells.iter(&txn) {
|
||||
if let Ok(m) = out.cast::<MapRef>() {
|
||||
if let Some(field_type) = m.get(&txn, "field_type") {
|
||||
if let Out::Any(a) = field_type {
|
||||
if let any::Any::BigInt(n) = a {
|
||||
if let Some(Out::Any(any::Any::BigInt(n))) = m.get(&txn, "field_type") {
|
||||
if n == FieldType::Relation as i64 {
|
||||
let relation_data = m.get(&txn, "data").ok_or_else(|| {
|
||||
AppError::RecordNotFound("no data found in relation cell".to_string())
|
||||
|
|
@ -762,19 +754,15 @@ impl PublishCollabDuplicator {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for rel_row_ids in rel_row_idss {
|
||||
let num_refs = rel_row_ids.len(&txn);
|
||||
|
||||
let mut pub_row_ids = Vec::with_capacity(num_refs as usize);
|
||||
for rel_row_id in rel_row_ids.iter(&txn) {
|
||||
if let Out::Any(a) = rel_row_id {
|
||||
if let any::Any::String(s) = a {
|
||||
if let Out::Any(any::Any::String(s)) = rel_row_id {
|
||||
pub_row_ids.push(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
rel_row_ids.remove_range(&mut txn, 0, num_refs);
|
||||
for pub_row_id in pub_row_ids {
|
||||
let dup_row_id = self
|
||||
|
|
|
|||
Loading…
Reference in New Issue