From 49a86ea19e9e72b206282d3c87ec489de058e950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Joly?= Date: Sun, 17 Dec 2023 14:28:29 +0000 Subject: [PATCH 1/2] chore: Bump edition to 2021 --- CHANGELOG.md | 6 ++++++ rusqlite_migration/Cargo.toml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35ed0bd..7a6b060 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Version 1.2.0 Alpha 1 + +### Minimum Rust Version + +Now using edition 2021 + ## Version 1.1.0 *Same code as version 1.1.0-beta.1* diff --git a/rusqlite_migration/Cargo.toml b/rusqlite_migration/Cargo.toml index a890e95..cdb4852 100644 --- a/rusqlite_migration/Cargo.toml +++ b/rusqlite_migration/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "rusqlite_migration" -version = "1.1.0" +version = "1.2.0-alpha.1" authors = ["Clément Joly "] -edition = "2018" +edition = "2021" license = "Apache-2.0" description = "Simple schema migration library for rusqlite using user_version instead of an SQL table to maintain the current schema version." keywords = ["rusqlite", "sqlite", "user_version", "database", "migration"] From bb2be3188881e2b181ed1299ab09a9ce32ff80d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Joly?= Date: Tue, 26 Dec 2023 16:15:52 +0000 Subject: [PATCH 2/2] chore: refresh cargo manifests Use features from new rust versons, in particular to factor out linter directives in the Cargo.toml files. --- Cargo.toml | 4 ++++ rusqlite_migration/Cargo.toml | 3 +++ rusqlite_migration/benches/criterion.rs | 2 ++ rusqlite_migration/benches/iai.rs | 6 +++--- rusqlite_migration/build.rs | 2 ++ rusqlite_migration/src/lib.rs | 2 -- rusqlite_migration_tokio_async/Cargo.toml | 6 +++++- rusqlite_migration_tokio_async/src/lib.rs | 3 +++ 8 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e780954..8c38e9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,3 +7,7 @@ members = [ # https://doc.rust-lang.org/cargo/reference/resolver.html#feature-resolver-version-2 resolver = "2" + +[workspace.lints.rust] +unsafe_code = "forbid" +missing_docs = "warn" diff --git a/rusqlite_migration/Cargo.toml b/rusqlite_migration/Cargo.toml index cdb4852..3b2169a 100644 --- a/rusqlite_migration/Cargo.toml +++ b/rusqlite_migration/Cargo.toml @@ -19,6 +19,9 @@ rust-version = "1.70" all-features = true rustdoc-args = ["--cfg", "docsrs"] +[lints] +workspace = true + [features] default = [] ### Enable support for async migrations with the use of `tokio-rusqlite` diff --git a/rusqlite_migration/benches/criterion.rs b/rusqlite_migration/benches/criterion.rs index b554ed9..35bf40f 100644 --- a/rusqlite_migration/benches/criterion.rs +++ b/rusqlite_migration/benches/criterion.rs @@ -14,6 +14,8 @@ limitations under the License. */ +//! Benchmarks using criterion + use criterion::criterion_main; #[cfg(feature = "from-directory")] diff --git a/rusqlite_migration/benches/iai.rs b/rusqlite_migration/benches/iai.rs index bbf0dee..6a50895 100644 --- a/rusqlite_migration/benches/iai.rs +++ b/rusqlite_migration/benches/iai.rs @@ -14,15 +14,15 @@ limitations under the License. */ +//! Why criterion and iai? It’s actually recommended: +//! https://bheisler.github.io/criterion.rs/book/iai/comparison.html + use std::iter::FromIterator; use iai::black_box; use rusqlite::Connection; use rusqlite_migration::{Migrations, M}; -// Why criterion and iai? It’s actually recommended: -// https://bheisler.github.io/criterion.rs/book/iai/comparison.html - fn upward(i: u64) { let sql_migrations = (0..=i) .map(|i| { diff --git a/rusqlite_migration/build.rs b/rusqlite_migration/build.rs index aa266e8..21b275e 100644 --- a/rusqlite_migration/build.rs +++ b/rusqlite_migration/build.rs @@ -1,3 +1,5 @@ +//! Insert the readme as documentation of the crate + use std::{ env, error::Error, diff --git a/rusqlite_migration/src/lib.rs b/rusqlite_migration/src/lib.rs index f73c04f..e25f09a 100644 --- a/rusqlite_migration/src/lib.rs +++ b/rusqlite_migration/src/lib.rs @@ -15,8 +15,6 @@ limitations under the License. */ #![cfg_attr(docsrs, feature(doc_auto_cfg))] -#![forbid(unsafe_code)] -#![warn(missing_docs)] // The doc is extracted from the README.md file at build time #![doc = include_str!(concat!(env!("OUT_DIR"), "/readme_for_rustdoc.md"))] diff --git a/rusqlite_migration_tokio_async/Cargo.toml b/rusqlite_migration_tokio_async/Cargo.toml index e191bc7..b7d6dbd 100644 --- a/rusqlite_migration_tokio_async/Cargo.toml +++ b/rusqlite_migration_tokio_async/Cargo.toml @@ -2,7 +2,7 @@ name = "rusqlite_migration_tokio_async" version = "0.0.1-alpha1" authors = ["Clément Joly "] -edition = "2018" +edition = "2021" license = "Apache-2.0" description = "Simple schema migration library for rusqlite using user_version instead of an SQL table to maintain the current schema version." keywords = ["rusqlite", "sqlite", "user_version", "database", "migration"] @@ -10,3 +10,7 @@ categories = ["database"] readme = "README.md" homepage = "https://cj.rs/rusqlite_migration" repository = "https://github.com/cljoly/rusqlite_migration/tree/master/rusqlite_migration_tokio_async" + +[lints] +workspace = true + diff --git a/rusqlite_migration_tokio_async/src/lib.rs b/rusqlite_migration_tokio_async/src/lib.rs index 1751e6f..4d9bd03 100644 --- a/rusqlite_migration_tokio_async/src/lib.rs +++ b/rusqlite_migration_tokio_async/src/lib.rs @@ -1,3 +1,6 @@ +//! Might eventually hold the async code + +/// Add pub fn add(left: usize, right: usize) -> usize { left + right }