Repository: toml-rs/toml (language: rust)

Issue:
toml_edit: Confusing deprecation message - decor_mut states it's deprecated in favour of itself
As of toml_edit 0.21.1, `KeyMut::decor_mut` is marked as deprecated in favour of itself: https://docs.rs/toml_edit/0.22.5/toml_edit/struct.KeyMut.html#method.decor_mut

I'm not clear on whether this is a typo or something else, but I'm not clear on what changes I should make to my code from this.


Discussion / hints:

Fix patch:
diff --git a/crates/toml_edit/src/key.rs b/crates/toml_edit/src/key.rs
index 8ae2dd13..f531890e 100644
--- a/crates/toml_edit/src/key.rs
+++ b/crates/toml_edit/src/key.rs
@@ -113,7 +113,10 @@ impl Key {
     }
 
     /// Returns the surrounding whitespace
-    #[deprecated(since = "0.21.1", note = "Replaced with `decor_mut`")]
+    #[deprecated(
+        since = "0.21.1",
+        note = "Replaced with `dotted_decor_mut`, `leaf_decor_mut"
+    )]
     pub fn decor_mut(&mut self) -> &mut Decor {
         self.leaf_decor_mut()
     }
@@ -129,7 +132,7 @@ impl Key {
     }
 
     /// Returns the surrounding whitespace
-    #[deprecated(since = "0.21.1", note = "Replaced with `decor`")]
+    #[deprecated(since = "0.21.1", note = "Replaced with `dotted_decor`, `leaf_decor")]
     pub fn decor(&self) -> &Decor {
         self.leaf_decor()
     }
@@ -360,7 +363,10 @@ impl<'k> KeyMut<'k> {
     }
 
     /// Returns the surrounding whitespace
-    #[deprecated(since = "0.21.1", note = "Replaced with `decor_mut`")]
+    #[deprecated(
+        since = "0.21.1",
+        note = "Replaced with `dotted_decor_mut`, `leaf_decor_mut"
+    )]
     pub fn decor_mut(&mut self) -> &mut Decor {
         #![allow(deprecated)]
         self.key.decor_mut()
@@ -377,7 +383,7 @@ impl<'k> KeyMut<'k> {
     }
 
     /// Returns the surrounding whitespace
-    #[deprecated(since = "0.21.1", note = "Replaced with `decor`")]
+    #[deprecated(since = "0.21.1", note = "Replaced with `dotted_decor`, `leaf_decor")]
     pub fn decor(&self) -> &Decor {
         #![allow(deprecated)]
         self.key.decor()


Test patch: