Skip to content

Commit ba8ff26

Browse files
committed
Ran cargo fmt
1 parent 4b1676d commit ba8ff26

File tree

5 files changed

+35
-22
lines changed

5 files changed

+35
-22
lines changed

optd-cost-model/src/cost/agg.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

optd-persistent/src/cost_model/orm.rs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,13 @@ impl CostModelStorageLayer for BackendManager {
453453
.collect::<Vec<_>>();
454454

455455
if attr_ids.len() != attr_base_indices.len() {
456-
return Err(BackendError::CostModel(format!(
457-
"Not all attributes found for table_id {} and base indices {:?}",
458-
table_id, attr_base_indices
459-
).into()));
456+
return Err(BackendError::CostModel(
457+
format!(
458+
"Not all attributes found for table_id {} and base indices {:?}",
459+
table_id, attr_base_indices
460+
)
461+
.into(),
462+
));
460463
}
461464

462465
self.get_stats_for_attr(attr_ids, stat_type, epoch_id).await
@@ -508,10 +511,13 @@ impl CostModelStorageLayer for BackendManager {
508511
.one(&self.db)
509512
.await?;
510513
if expr_exists.is_none() {
511-
return Err(BackendError::CostModel(format!(
512-
"physical expression id {} not found when storing cost",
513-
physical_expression_id
514-
).into()));
514+
return Err(BackendError::CostModel(
515+
format!(
516+
"physical expression id {} not found when storing cost",
517+
physical_expression_id
518+
)
519+
.into(),
520+
));
515521
}
516522

517523
// Check if epoch_id exists in Event table
@@ -521,10 +527,9 @@ impl CostModelStorageLayer for BackendManager {
521527
.await
522528
.unwrap();
523529
if epoch_exists.is_none() {
524-
return Err(BackendError::CostModel(format!(
525-
"epoch id {} not found when storing cost",
526-
epoch_id
527-
).into()));
530+
return Err(BackendError::CostModel(
531+
format!("epoch id {} not found when storing cost", epoch_id).into(),
532+
));
528533
}
529534

530535
let new_cost = plan_cost::ActiveModel {

optd-persistent/src/migrator/memo/m20241029_000001_predicate.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ Table predicate {
66
}
77
*/
88

9-
use sea_orm_migration::{prelude::*, schema::{integer, json, pk_auto}};
9+
use sea_orm_migration::{
10+
prelude::*,
11+
schema::{integer, json, pk_auto},
12+
};
1013

1114
#[derive(Iden)]
1215
pub enum Predicate {

optd-persistent/src/migrator/memo/m20241029_000001_predicate_logical_expression_junction.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ Table predicate_logical_expression_junction {
77

88
use sea_orm_migration::{prelude::*, schema::integer};
99

10-
use super::{m20241029_000001_logical_expression::LogicalExpression, m20241029_000001_predicate::Predicate};
10+
use super::{
11+
m20241029_000001_logical_expression::LogicalExpression, m20241029_000001_predicate::Predicate,
12+
};
1113

1214
#[derive(Iden)]
1315
pub enum PredicateLogicalExpressionJunction {
@@ -19,7 +21,6 @@ pub enum PredicateLogicalExpressionJunction {
1921
#[derive(DeriveMigrationName)]
2022
pub struct Migration;
2123

22-
2324
#[async_trait::async_trait]
2425
impl MigrationTrait for Migration {
2526
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
@@ -53,18 +54,19 @@ impl MigrationTrait for Migration {
5354
Index::create()
5455
.col(PredicateLogicalExpressionJunction::LogicalExprId)
5556
.col(PredicateLogicalExpressionJunction::PredicateId),
56-
5757
)
5858
.to_owned(),
59-
)
59+
)
6060
.await
6161
}
6262

6363
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
6464
manager
65-
.drop_table(Table::drop().table(PredicateLogicalExpressionJunction::Table).to_owned())
65+
.drop_table(
66+
Table::drop()
67+
.table(PredicateLogicalExpressionJunction::Table)
68+
.to_owned(),
69+
)
6670
.await
6771
}
68-
}
69-
70-
72+
}

optd-persistent/src/migrator/memo/m20241029_000001_predicate_physical_expression_junction.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ Table predicate_physical_expression_junction {
77

88
use sea_orm_migration::{prelude::*, schema::integer};
99

10-
use super::{m20241029_000001_physical_expression::PhysicalExpression, m20241029_000001_predicate::Predicate};
10+
use super::{
11+
m20241029_000001_physical_expression::PhysicalExpression, m20241029_000001_predicate::Predicate,
12+
};
1113

1214
#[derive(Iden)]
1315
pub enum PredicatePhysicalExpressionJunction {

0 commit comments

Comments
 (0)