Skip to content

Commit

Permalink
chore(query-engine-wasm): fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jkomyno committed Jan 2, 2024
1 parent d8e6a9e commit a4f39a7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion quaint/src/connector/mssql/native/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ impl Queryable for Mssql {
let rows = self.query_raw(query, &[]).await?;

let version_string = rows
.get(0)
.first()
.and_then(|row| row.get("version").and_then(|version| version.to_string()));

Ok(version_string)
Expand Down
2 changes: 1 addition & 1 deletion quaint/src/connector/mysql/native/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ impl Queryable for Mysql {
let rows = timeout::socket(self.socket_timeout, self.query_raw(query, &[])).await?;

let version_string = rows
.get(0)
.first()
.and_then(|row| row.get("version").and_then(|version| version.typed.to_string()));

Ok(version_string)
Expand Down
2 changes: 1 addition & 1 deletion quaint/src/connector/postgres/native/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ impl Queryable for PostgreSql {
let rows = self.query_raw(query, &[]).await?;

let version_string = rows
.get(0)
.first()
.and_then(|row| row.get("version").and_then(|version| version.to_string()));

Ok(version_string)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ where

let version =
schema_exists_result
.get(0)
.first()
.and_then(|row| row.at(1).and_then(|ver_str| row.at(2).map(|ver_num| (ver_str, ver_num))))
.and_then(|(ver_str,ver_num)| ver_str.to_string().and_then(|version| ver_num.as_integer().map(|version_number| (version, version_number))));

Expand Down Expand Up @@ -625,7 +625,7 @@ where
}

if let Some(true) = schema_exists_result
.get(0)
.first()
.and_then(|row| row.at(0).and_then(|value| value.as_bool()))
{
return Ok((circumstances, connection))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl<'a> DefaultValuePair<'a> {
Some(previous) if previous.is_nanoid() => {
let length = previous.value().as_function().and_then(|(_, args, _)| {
args.arguments
.get(0)
.first()
.map(|arg| arg.value.as_numeric_value().unwrap().0.parse::<u8>().unwrap())
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub(crate) fn calculate_sql_schema(datamodel: &ValidatedSchema, flavour: &dyn Sq
schemas: Default::default(),
};

if let Some(ds) = context.datamodel.configuration.datasources.get(0) {
if let Some(ds) = context.datamodel.configuration.datasources.first() {
for (schema, _) in &ds.namespaces {
context
.schemas
Expand Down Expand Up @@ -608,6 +608,6 @@ fn unwrap_dbgenerated(expr: &ast::Expression) -> Option<String> {
.unwrap()
.1
.arguments
.get(0)
.first()
.map(|arg| arg.value.as_string_value().unwrap().0.to_owned())
}

0 comments on commit a4f39a7

Please sign in to comment.