diff --git a/quaint/src/connector/mssql/native/mod.rs b/quaint/src/connector/mssql/native/mod.rs index d22aa7a15dd6..124e14ac94d0 100644 --- a/quaint/src/connector/mssql/native/mod.rs +++ b/quaint/src/connector/mssql/native/mod.rs @@ -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) diff --git a/quaint/src/connector/mysql/native/mod.rs b/quaint/src/connector/mysql/native/mod.rs index fdcc3a6276d1..98feb2649763 100644 --- a/quaint/src/connector/mysql/native/mod.rs +++ b/quaint/src/connector/mysql/native/mod.rs @@ -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) diff --git a/quaint/src/connector/postgres/native/mod.rs b/quaint/src/connector/postgres/native/mod.rs index 30f34e7002be..d656bceb1e00 100644 --- a/quaint/src/connector/postgres/native/mod.rs +++ b/quaint/src/connector/postgres/native/mod.rs @@ -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) diff --git a/schema-engine/connectors/sql-schema-connector/src/flavour/postgres.rs b/schema-engine/connectors/sql-schema-connector/src/flavour/postgres.rs index 4942f0f4eff5..83c641797872 100644 --- a/schema-engine/connectors/sql-schema-connector/src/flavour/postgres.rs +++ b/schema-engine/connectors/sql-schema-connector/src/flavour/postgres.rs @@ -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)))); @@ -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)) diff --git a/schema-engine/connectors/sql-schema-connector/src/introspection/introspection_pair/default.rs b/schema-engine/connectors/sql-schema-connector/src/introspection/introspection_pair/default.rs index 0c5f6f1f0a45..dcb04371439b 100644 --- a/schema-engine/connectors/sql-schema-connector/src/introspection/introspection_pair/default.rs +++ b/schema-engine/connectors/sql-schema-connector/src/introspection/introspection_pair/default.rs @@ -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::().unwrap()) }); diff --git a/schema-engine/connectors/sql-schema-connector/src/sql_schema_calculator.rs b/schema-engine/connectors/sql-schema-connector/src/sql_schema_calculator.rs index 10a87b96d5a5..3516d0136045 100644 --- a/schema-engine/connectors/sql-schema-connector/src/sql_schema_calculator.rs +++ b/schema-engine/connectors/sql-schema-connector/src/sql_schema_calculator.rs @@ -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 @@ -608,6 +608,6 @@ fn unwrap_dbgenerated(expr: &ast::Expression) -> Option { .unwrap() .1 .arguments - .get(0) + .first() .map(|arg| arg.value.as_string_value().unwrap().0.to_owned()) }