From f590b8a181a4584fa7a4ab56fa3f7124e23e9fb4 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sun, 10 Dec 2023 09:13:01 -0500 Subject: [PATCH 1/2] 2021 edition; bump dependencies --- Cargo.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 81af4ba..4f81c50 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "dynfmt" version = "0.1.5" authors = ["Jan Michael Auer "] -edition = "2018" +edition = "2021" license = "MIT" readme = "README.md" repository = "https://github.com/jan-auer/dynfmt" @@ -16,11 +16,11 @@ A crate for formatting strings dynamically. all-features = true [dependencies] -erased-serde = "0.3.6" -lazy_static = { version = "1.2.0", optional = true } -regex = { version = "1.1.0", optional = true } -serde = "1.0.84" -serde_json = { version = "1.0.36", optional = true } +erased-serde = "0.4" +lazy_static = { version = "1.4", optional = true } +regex = { version = "1", optional = true } +serde = "1" +serde_json = { version = "1", optional = true } thiserror = "1.0" [features] From 0dec5eaceba58e294283d8ebc6333b421220c186 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sun, 10 Dec 2023 09:14:33 -0500 Subject: [PATCH 2/2] clippy::swap_ptr_to_ref warning: call to `core::mem::swap` with a parameter derived from a raw pointer --> src/formatter.rs:145:13 | 145 | mem::swap(self, &mut *placeholder.as_mut_ptr()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use ptr::swap: `core::ptr::swap(self, placeholder.as_mut_ptr())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#swap_ptr_to_ref = note: `#[warn(clippy::swap_ptr_to_ref)]` on by default --- src/formatter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/formatter.rs b/src/formatter.rs index f8d0c13..dc68de9 100644 --- a/src/formatter.rs +++ b/src/formatter.rs @@ -142,7 +142,7 @@ where { unsafe { let mut placeholder = MaybeUninit::uninit(); - mem::swap(self, &mut *placeholder.as_mut_ptr()); + core::ptr::swap(self, placeholder.as_mut_ptr()); let converted = f(placeholder.assume_init().into_inner()); mem::forget(mem::replace(self, converted)); }