diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d39d8d..15f0403 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org). ## Unreleased +## 0.1.4 - 2024-12-05 + +- MSRV 1.81 +- bump virtue to 0.0.18 +- bump dev dependencies +- small refactorings after extended lint checks +- doc fixed typo + assertion + ## 0.1.3 - 2024-07-05 - tests extended diff --git a/Cargo.toml b/Cargo.toml index 7c51ef9..005521d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "wb_sqlite" -version = "0.1.3" +version = "0.1.4" authors = ["Werner Braun "] edition = "2021" -# sqlx-core needs 1.74 impl_trait_projections -rust-version = "1.74" +# idna 1.0.3 needs 1.81 error in core +rust-version = "1.81" description = "Derive map of struct/field to SQLite table/column. Generate const/fn for create-table, insert, select, update." repository = "https://github.com/wbcat/wb_sqlite" license = "MIT OR Apache-2.0" @@ -16,10 +16,10 @@ proc-macro = true [dependencies] convert_case = "0.6.0" -virtue = "0.0.17" +virtue = "0.0.18" [dev-dependencies] -# sqlx 0.7.4 needs rusqlite 0.30.0 -rusqlite = { version = "0.30.0", features = ["bundled"] } -sqlx = { version = "0.7.4", features = ["sqlite", "runtime-tokio"] } -tokio = { version = "1.38.0", features = ["rt", "macros"] } +# sqlx 0.8.2 needs rusqlite 0.32.1 +rusqlite = { version = "0.32.1", features = ["bundled"] } +sqlx = { version = "0.8.2", features = ["sqlite", "runtime-tokio"] } +tokio = { version = "1.42.0", features = ["rt", "macros"] } diff --git a/Cranky.toml b/Cranky.toml index d2aa7ba..68f2fe9 100644 --- a/Cranky.toml +++ b/Cranky.toml @@ -1,4 +1,4 @@ -# Rust 1.79 +# Rust 1.83 # https://crates.io/crates/cargo-cranky # https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html # https://rust-lang.github.io/rust-clippy/master/ @@ -29,7 +29,6 @@ warn = [ "unused_qualifications", "variant_size_differences", # clippy - "clippy::allow_attributes", "clippy::allow_attributes_without_reason", "clippy::as_ptr_cast_mut", "clippy::as_underscore", @@ -39,6 +38,7 @@ warn = [ "clippy::borrow_as_ptr", "clippy::branches_sharing_code", "clippy::cast_lossless", + "clippy::cfg_not_test", "clippy::clear_with_drain", "clippy::clone_on_ref_ptr", "clippy::cloned_instead_of_copied", @@ -102,6 +102,7 @@ warn = [ "clippy::manual_assert", "clippy::manual_c_str_literals", "clippy::manual_instant_elapsed", + "clippy::manual_is_power_of_two", "clippy::manual_is_variant_and", "clippy::manual_let_else", "clippy::manual_ok_or", @@ -131,11 +132,13 @@ warn = [ "clippy::needless_raw_string_hashes", "clippy::needless_raw_strings", "clippy::negative_feature_names", + "clippy::non_zero_suggestions", "clippy::nonstandard_macro_braces", "clippy::option_as_ref_cloned", "clippy::option_if_let_else", "clippy::option_option", "clippy::path_buf_push_overwrite", + "clippy::pathbuf_init_then_push", "clippy::ptr_as_ptr", "clippy::ptr_cast_constness", "clippy::pub_underscore_fields", @@ -149,11 +152,14 @@ warn = [ "clippy::redundant_type_annotations", "clippy::ref_as_ptr", "clippy::ref_binding_to_reference", + "clippy::ref_option", "clippy::ref_option_ref", "clippy::ref_patterns", "clippy::rest_pat_in_fully_bound_structs", "clippy::same_functions_in_if_condition", "clippy::same_name_method", + "clippy::set_contains_or_insert", + "clippy::single_char_pattern", "clippy::single_match_else", "clippy::str_split_at_newline", "clippy::str_to_string", @@ -164,6 +170,7 @@ warn = [ "clippy::suspicious_operation_groupings", "clippy::suspicious_xor_used_as_pow", "clippy::tests_outside_test_module", + "clippy::too_long_first_doc_paragraph", "clippy::trailing_empty_array", "clippy::trait_duplication_in_bounds", "clippy::transmute_ptr_to_ptr", @@ -186,12 +193,15 @@ warn = [ "clippy::unreadable_literal", "clippy::unseparated_literal_suffix", "clippy::unused_peekable", + "clippy::unused_result_ok", "clippy::unused_rounding", "clippy::unused_self", "clippy::use_self", "clippy::used_underscore_binding", + "clippy::used_underscore_items", "clippy::useless_let_if_seq", "clippy::verbose_file_reads", + "clippy::while_float", "clippy::wildcard_dependencies", "clippy::wildcard_imports", "clippy::zero_sized_map_values", diff --git a/src/get.rs b/src/get.rs index afa48fc..e3a7916 100644 --- a/src/get.rs +++ b/src/get.rs @@ -60,7 +60,7 @@ fn gen_struct( let mut gen_impl = generator.generate_impl(); if !pk.is_empty() { gen_impl - .generate_fn(&format!("get_by_{pk}")) + .generate_fn(format!("get_by_{pk}")) .as_async() .with_arg(&pk, &pk_typ) .with_arg("exec", "impl ::sqlx::SqliteExecutor<'_>") @@ -84,7 +84,7 @@ fn gen_struct( unique_typ.pop(); for (col, typ) in std::iter::zip(unique.split(','), unique_typ.split(',')) { gen_impl - .generate_fn(&format!("get_by_{col}")) + .generate_fn(format!("get_by_{col}")) .as_async() .with_arg(col, typ) .with_arg("exec", "impl ::sqlx::SqliteExecutor<'_>") diff --git a/src/lib.rs b/src/lib.rs index b342960..c1d461d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,7 +27,7 @@ use virtue::prelude::TokenStream; /// name: String, /// #[sql(constraint = "REFERENCES parent(id) ON UPDATE RESTRICT ON DELETE RESTRICT")] /// mother: i64, -/// #[sql(constraint = "rEFERENCES parent(id) ON UPDATE RESTRICT ON DELETE RESTRICT")] +/// #[sql(constraint = "REFERENCES parent(id) ON UPDATE RESTRICT ON DELETE RESTRICT")] /// father: i64, /// #[sql(constraint = "REFERENCES human(id) ON UPDATE RESTRICT ON DELETE RESTRICT")] /// owner: i64, @@ -36,6 +36,7 @@ use virtue::prelude::TokenStream; /// Cat::CREATE_INDEX_SQL, /// concat!( /// "CREATE INDEX IF NOT EXISTS cat_mother_idx ON cat(mother); ", +/// "CREATE INDEX IF NOT EXISTS cat_father_idx ON cat(father); ", /// "CREATE INDEX IF NOT EXISTS cat_owner_idx ON cat(owner); " /// ) /// );