Skip to content

Commit

Permalink
fix: fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jacek-prisma committed Jan 14, 2025
1 parent 8752e62 commit 7a28a11
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions query-engine/core/src/compiler/expression/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ where

pub fn expression(&'a self, expression: &'a Expression) -> DocBuilder<'a, PrettyPrinter<'a, D>, ColorSpec> {
match expression {
Expression::Seq(vec) => self.seq(&vec),
Expression::Get { name } => self.get(&name),
Expression::Let { bindings, expr } => self.r#let(&bindings, &expr),
Expression::GetFirstNonEmpty { names } => self.get_first_non_empty(&names),
Expression::Query(db_query) => self.query("query", &db_query),
Expression::Execute(db_query) => self.query("execute", &db_query),
Expression::Reverse(expression) => self.unary_function("reverse", &expression),
Expression::Sum(vec) => self.function("sum", &vec),
Expression::Concat(vec) => self.function("concat", &vec),
Expression::Seq(vec) => self.seq(vec),
Expression::Get { name } => self.get(name),
Expression::Let { bindings, expr } => self.r#let(bindings, expr),
Expression::GetFirstNonEmpty { names } => self.get_first_non_empty(names),
Expression::Query(db_query) => self.query("query", db_query),
Expression::Execute(db_query) => self.query("execute", db_query),
Expression::Reverse(expression) => self.unary_function("reverse", expression),
Expression::Sum(vec) => self.function("sum", vec),
Expression::Concat(vec) => self.function("concat", vec),
Expression::Unique(expression) => self.unary_function("unique", expression),
Expression::Required(expression) => self.unary_function("required", expression),
Expression::Join { parent, children } => self.join(&parent, &children),
Expression::MapField { field, records } => self.map_field(&field, &records),
Expression::Join { parent, children } => self.join(parent, children),
Expression::MapField { field, records } => self.map_field(field, records),
}
}

Expand Down Expand Up @@ -116,7 +116,7 @@ where
})
.parens(),
),
PrismaValue::List(values) => self.list(&values),
PrismaValue::List(values) => self.list(values),
_ => self
.keyword("const")
.append(self.text(format!("{value:?}")).annotate(color_lit()).parens()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ impl Alias {

/// A string representation of the current alias. The current mode can be
/// overridden by defining the `mode_override`.
pub fn to_string(&self, mode_override: Option<AliasMode>) -> String {
pub fn to_string(self, mode_override: Option<AliasMode>) -> String {
match mode_override.unwrap_or(self.mode) {
AliasMode::Table => format!("t{}", self.counter),
AliasMode::Join => format!("j{}", self.counter),
}
}

#[cfg(feature = "relation_joins")]
pub fn to_table_string(&self) -> String {
pub fn to_table_string(self) -> String {
self.to_string(Some(AliasMode::Table))
}
}
Expand Down

0 comments on commit 7a28a11

Please sign in to comment.