Repository: mitsuhiko/minijinja (language: rust)

Issue:
2.0: Rename Value::from_serializable
That name annoys me from the beginning of time.  I think a better name would at least be `Value::from_serialize`.


Discussion / hints:
In Figment, I call it [`Value::serialize()`](https://docs.rs/figment/latest/figment/value/enum.Value.html#method.serialize), but just today I was wondering if this was the right name. It's bit of an odd thing to name, since you're taking something that serializable and serializing it into a `Value`. `serde_json` exposes the functionality under a standalone function named [`to_value()`](https://docs.rs/serde_json/latest/serde_json/fn.to_value.html), circumnavigating the issue entirely.

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0e0d5e7e..668a77ca 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -51,6 +51,7 @@ For upgrade instructions read the [UPDATING](UPDATING.md) guide.
 - Added the `iterable` test.  #475
 - The parser no longer panics when using dotted assignments in unexpected places. #479
 - The CLI now enables unicode support by default.
+- `Value::from_serializable` is now `Value::from_serialize`.
 
 ## 1.0.17
 
diff --git a/minijinja/src/value/mod.rs b/minijinja/src/value/mod.rs
index dca82682..694e0c6f 100644
--- a/minijinja/src/value/mod.rs
+++ b/minijinja/src/value/mod.rs
@@ -599,20 +599,6 @@ impl Value {
         transform(value)
     }
 
-    /// Deprecated original name of [`Value::from_serialize`].
-    ///
-    /// This method was replaced by the more generic method [`Value::from_serialize`]
-    /// which also takes values by either reference or value.
-    #[deprecated(
-        since = "1.17.0",
-        note = "this method was replaced by Value::from_serialize"
-    )]
-    pub fn from_serializable<T: Serialize>(value: &T) -> Value {
-        let _serialization_guard = mark_internal_serialization();
-        let _optimization_guard = value_optimization();
-        transform(value)
-    }
-
     /// Creates a value from a safe string.
     ///
     /// A safe string is one that will bypass auto escaping.  For instance if you
@@ -674,7 +660,8 @@ impl Value {
     ///
     ///     fn get_value(self: &Arc<Self>, key: &Value) -> Option<Value> {
     ///         match key.as_str()? {
-    ///             Some("port") => Value::from(self.port),
+    ///             "port" => Some(Value::from(self.port)),
+    ///             _ => None,
     ///         }
     ///     }
     /// }
@@ -686,7 +673,8 @@ impl Value {
     ///
     ///     fn get_value(self: &Arc<Self>, key: &Value) -> Option<Value> {
     ///         match key.as_str()? {
-    ///             Some("http") => Value::from_dyn_object(self.http.clone()),
+    ///             "http" => Some(Value::from_dyn_object(self.http.clone())),
+    ///             _ => None
     ///         }
     ///     }
     /// }


Test patch: