Description: Relax strict salsa dependency
Author: Michael R. Crusoe <crusoe@debian.org>
Forwarded: not-needed
--- char-str.orig/Cargo.toml
+++ char-str/Cargo.toml
@@ -50,10 +50,6 @@
     "std",
     "dep:get-size2",
 ]
-salsa = [
-    "std",
-    "dep:salsa",
-]
 serde = ["dep:serde_core"]
 std = []
 
@@ -102,10 +98,6 @@
 path = "tests/race_condition.rs"
 
 [[test]]
-name = "salsa"
-path = "tests/salsa.rs"
-
-[[test]]
 name = "serde"
 path = "tests/serde.rs"
 
@@ -129,11 +121,6 @@
 [dependencies.ryu]
 version = "1.0"
 
-[dependencies.salsa]
-version = "0.27.2"
-optional = true
-default-features = false
-
 [dependencies.serde_core]
 version = "1.0"
 optional = true
--- char-str.orig/Cargo.toml.orig
+++ char-str/Cargo.toml.orig
@@ -14,7 +14,6 @@
 default = ["std"]
 std = []
 get-size = ["std", "dep:get-size2"]
-salsa = ["std", "dep:salsa"]
 serde = ["dep:serde_core"]
 
 [dependencies]
@@ -23,7 +22,6 @@
 castaway = { version = "0.2.4", default-features = false, features = ["alloc"] }
 arbitrary = { version = "1", optional = true, default-features = false }
 get-size2 = { version = "0.11.0", optional = true }
-salsa = { version = "0.27.2", optional = true, default-features = false }
 serde_core = { version = "1.0", optional = true, default-features = false }
 
 [dev-dependencies]
--- char-str.orig/src/features.rs
+++ char-str/src/features.rs
@@ -6,6 +6,3 @@
 
 #[cfg(feature = "get-size")]
 mod get_size;
-
-#[cfg(feature = "salsa")]
-mod salsa;
--- char-str.orig/src/features/salsa.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-use crate::{CharStr, CharString};
-
-// SAFETY: `CharString` owns all of its data and contains no borrowed state. Equal values can keep
-// the allocation from the previous revision; unequal values are fully replaced.
-#[cfg_attr(docsrs, doc(cfg(feature = "salsa")))]
-unsafe impl salsa::Update for CharString {
-    unsafe fn maybe_update(old_pointer: *mut Self, new_value: Self) -> bool {
-        // SAFETY: Salsa guarantees that `old_pointer` is valid and uniquely available for the
-        // duration of this call.
-        let old_value = unsafe { &mut *old_pointer };
-        if *old_value == new_value {
-            false
-        } else {
-            *old_value = new_value;
-            true
-        }
-    }
-}
-
-// SAFETY: `CharStr` owns all of its data and contains no borrowed state. Equal values can keep the
-// allocation from the previous revision; unequal values are fully replaced.
-#[cfg_attr(docsrs, doc(cfg(feature = "salsa")))]
-unsafe impl salsa::Update for CharStr {
-    unsafe fn maybe_update(old_pointer: *mut Self, new_value: Self) -> bool {
-        // SAFETY: Salsa guarantees that `old_pointer` is valid and uniquely available for the
-        // duration of this call.
-        let old_value = unsafe { &mut *old_pointer };
-        if *old_value == new_value {
-            false
-        } else {
-            *old_value = new_value;
-            true
-        }
-    }
-}
--- char-str.orig/tests/salsa.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-#![cfg(feature = "salsa")]
-
-use char_str::{CharStr, CharString};
-use salsa::Update;
-
-#[test]
-fn char_string_keeps_equal_values_and_replaces_changed_values() {
-    let mut old = CharString::with_capacity(128);
-    old.push_str("same");
-    let old_pointer = old.as_ptr();
-    let old_capacity = old.capacity();
-
-    // SAFETY: `old` is valid and exclusively borrowed for the duration of the update.
-    let changed = unsafe { CharString::maybe_update(&mut old, CharString::from("same")) };
-    assert!(!changed);
-    assert_eq!(old.as_ptr(), old_pointer);
-    assert_eq!(old.capacity(), old_capacity);
-
-    // SAFETY: `old` is valid and exclusively borrowed for the duration of the update.
-    let changed = unsafe { CharString::maybe_update(&mut old, CharString::from("different")) };
-    assert!(changed);
-    assert_eq!(old, "different");
-}
-
-#[test]
-fn char_str_keeps_equal_values_and_replaces_changed_values() {
-    let mut old = CharStr::from("a string longer than the inline limit");
-    let old_pointer = old.as_ptr();
-
-    // SAFETY: `old` is valid and exclusively borrowed for the duration of the update.
-    let changed = unsafe {
-        CharStr::maybe_update(&mut old, CharStr::from("a string longer than the inline limit"))
-    };
-    assert!(!changed);
-    assert_eq!(old.as_ptr(), old_pointer);
-
-    // SAFETY: `old` is valid and exclusively borrowed for the duration of the update.
-    let changed =
-        unsafe { CharStr::maybe_update(&mut old, CharStr::from("a different long string")) };
-    assert!(changed);
-    assert_eq!(old, "a different long string");
-}
