Skip to content

Commit 2259e7f

Browse files
committed
update edition to 2024
1 parent 398a3cd commit 2259e7f

File tree

9 files changed

+29
-23
lines changed

9 files changed

+29
-23
lines changed

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
resolver = "2"
33
members = ["macro", "core", "ormlite", "cli"]
44

5+
[workspace.package]
6+
version = "0.24.2"
7+
edition = "2024"
8+
59
[workspace.dependencies]
610
anyhow = "1"
711
futures = "0.3.31"

attr/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "ormlite-attr"
3-
version = "0.24.1"
4-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
55
description = "See `ormlite`."
66
authors = ["Kurt Wolf <kurtwolfbuilds@gmail.com>"]
77
license = "MIT"

attr/src/ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub trait DeriveInputExt {
77
impl DeriveInputExt for DeriveInput {
88
fn fields(&self) -> syn::punctuated::Iter<'_, Field> {
99
let fields = match &self.data {
10-
Data::Struct(DataStruct { ref fields, .. }) => fields,
10+
Data::Struct(DataStruct { fields, .. }) => fields,
1111
_ => panic!("#[ormlite] can only be used on structs"),
1212
};
1313
let fields = match fields {

cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "ormlite-cli"
3-
version = "0.24.1"
4-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
55
description = "An ORM for people who love SQL. Use the `ormlite` crate, not this one."
66
authors = ["Kurt Wolf <kurtwolfbuilds@gmail.com>"]
77
license = "MIT"

core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "ormlite-core"
3-
version = "0.24.2"
4-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
55
description = "An ORM for people who love SQL. Use the `ormlite` crate, not this one."
66
authors = ["Kurt Wolf <kurtwolfbuilds@gmail.com>"]
77
license = "MIT"

core/src/query_builder/select.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use crate::error::{Error, Result};
22
use crate::model::Model;
33
use crate::query_builder::args::QueryBuilderArgs;
4-
use crate::query_builder::{util, Placeholder};
4+
use crate::query_builder::{Placeholder, util};
55
use sql::{Expr, OrderBy, ToSql};
66

7-
use crate::join::{criteria, select_columns, JoinDescription};
8-
use sql::{query::Where, Select};
7+
use crate::join::{JoinDescription, criteria, select_columns};
8+
use sql::{Select, query::Where};
99
use sqlx::{Executor, IntoArguments};
1010
use std::marker::PhantomData;
1111

@@ -44,7 +44,7 @@ where
4444
pub query: Select,
4545
arguments: QueryBuilderArgs<'args, DB>,
4646
model: PhantomData<Model>,
47-
gen: Placeholder,
47+
placeholder: Placeholder,
4848
}
4949

5050
impl<'args, DB, M> SelectQueryBuilder<'args, DB, M>
@@ -234,7 +234,7 @@ where
234234
pub fn into_query_and_args(mut self) -> Result<(String, QueryBuilderArgs<'args, DB>)> {
235235
let q = self.query.to_sql(DB::dialect());
236236
let args = self.arguments;
237-
let (q, placeholder_count) = util::replace_placeholders(&q, &mut self.gen)?;
237+
let (q, placeholder_count) = util::replace_placeholders(&q, &mut self.placeholder)?;
238238
if placeholder_count != args.len() {
239239
return Err(Error::OrmliteError(format!(
240240
"Failing to build query. {} placeholders were found in the query, but \
@@ -253,7 +253,7 @@ impl<'args, DB: sqlx::Database + DatabaseMetadata, M: Model<DB>> Default for Sel
253253
query: Select::default().from(M::table_name()),
254254
arguments: QueryBuilderArgs::default(),
255255
model: PhantomData,
256-
gen: DB::placeholder(),
256+
placeholder: DB::placeholder(),
257257
}
258258
}
259259
}

macro/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "ormlite-macro"
3-
version = "0.24.1"
4-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
55
description = "An ORM for people who love SQL. Use the `ormlite` crate, not this one."
66
authors = ["Kurt Wolf <kurtwolfbuilds@gmail.com>"]
77
license = "MIT"

macro/src/lib.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ use std::sync::OnceLock;
1515
use syn::DataEnum;
1616

1717
use quote::quote;
18-
use syn::{parse_macro_input, Data, DeriveInput};
18+
use syn::{Data, DeriveInput, parse_macro_input};
1919

2020
use codegen::into_arguments::impl_IntoArguments;
21-
use ormlite_attr::schema_from_filepaths;
2221
use ormlite_attr::DeriveInputExt;
2322
use ormlite_attr::ModelMeta;
2423
use ormlite_attr::TableMeta;
24+
use ormlite_attr::schema_from_filepaths;
2525
use ormlite_core::config::get_var_model_folders;
2626

2727
use crate::codegen::common::OrmliteCodegen;
@@ -99,9 +99,11 @@ fn get_databases(table_meta: &TableMeta) -> Vec<Box<dyn OrmliteCodegen>> {
9999
count += 1;
100100
}
101101
if count > 1 {
102-
panic!("You have more than one database configured using features, but no database is specified for this model. \
102+
panic!(
103+
"You have more than one database configured using features, but no database is specified for this model. \
103104
Specify a database for the model like this:\n\n#[ormlite(database = \"<db>\")]\n\nOr you can enable \
104-
a default database feature:\n\n # Cargo.toml\normlite = {{ features = [\"default-<db>\"] }}");
105+
a default database feature:\n\n # Cargo.toml\normlite = {{ features = [\"default-<db>\"] }}"
106+
);
105107
}
106108
}
107109
if databases.is_empty() {
@@ -272,7 +274,7 @@ pub fn derive_ormlite_enum(input: TokenStream) -> TokenStream {
272274
.map(|v| v.to_string().to_case(Case::Snake))
273275
.collect();
274276

275-
let gen = quote! {
277+
let placeholder = quote! {
276278
impl std::fmt::Display for #enum_name {
277279
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
278280
match self {
@@ -330,5 +332,5 @@ pub fn derive_ormlite_enum(input: TokenStream) -> TokenStream {
330332
}
331333
};
332334

333-
gen.into()
335+
placeholder.into()
334336
}

ormlite/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "ormlite"
3-
version = "0.24.1"
4-
edition = "2021"
3+
version.workspace = true
4+
edition.workspace = true
55
authors = ["Kurt Wolf <kurtwolfbuilds@gmail.com>"]
66
description = "An ORM for people who love SQL"
77
license = "MIT"

0 commit comments

Comments
 (0)