Remove __NonExhaustive and replace with #[non_exhaustive].
This commit is contained in:
parent
e1998fda56
commit
dd7ae34670
@ -6,9 +6,13 @@ use serde_derive::{Deserialize, Serialize};
|
|||||||
/// Available kind of interpolations.
|
/// Available kind of interpolations.
|
||||||
///
|
///
|
||||||
/// Feel free to visit each variant for more documentation.
|
/// Feel free to visit each variant for more documentation.
|
||||||
|
#[non_exhaustive]
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
#[cfg_attr(feature = "serialization", derive(Deserialize, Serialize))]
|
#[cfg_attr(
|
||||||
#[cfg_attr(feature = "serialization", serde(rename_all = "snake_case"))]
|
feature = "serialization",
|
||||||
|
derive(Deserialize, Serialize),
|
||||||
|
serde(rename_all = "snake_case")
|
||||||
|
)]
|
||||||
pub enum Interpolation<T, V> {
|
pub enum Interpolation<T, V> {
|
||||||
/// Hold a [`Key`] until the sampling value passes the normalized step threshold, in which
|
/// Hold a [`Key`] until the sampling value passes the normalized step threshold, in which
|
||||||
/// case the next key is used.
|
/// case the next key is used.
|
||||||
@ -20,12 +24,16 @@ pub enum Interpolation<T, V> {
|
|||||||
///
|
///
|
||||||
/// [`Key`]: crate::key::Key
|
/// [`Key`]: crate::key::Key
|
||||||
Step(T),
|
Step(T),
|
||||||
|
|
||||||
/// Linear interpolation between a key and the next one.
|
/// Linear interpolation between a key and the next one.
|
||||||
Linear,
|
Linear,
|
||||||
|
|
||||||
/// Cosine interpolation between a key and the next one.
|
/// Cosine interpolation between a key and the next one.
|
||||||
Cosine,
|
Cosine,
|
||||||
|
|
||||||
/// Catmull-Rom interpolation, performing a cubic Hermite interpolation using four keys.
|
/// Catmull-Rom interpolation, performing a cubic Hermite interpolation using four keys.
|
||||||
CatmullRom,
|
CatmullRom,
|
||||||
|
|
||||||
/// Bézier interpolation.
|
/// Bézier interpolation.
|
||||||
///
|
///
|
||||||
/// A control point that uses such an interpolation is associated with an extra point. The segmant
|
/// A control point that uses such an interpolation is associated with an extra point. The segmant
|
||||||
@ -41,6 +49,7 @@ pub enum Interpolation<T, V> {
|
|||||||
/// point and the current control point’s associated point. This is called _quadratic Bézer
|
/// point and the current control point’s associated point. This is called _quadratic Bézer
|
||||||
/// interpolation_ and it kicks ass too, but a bit less than cubic.
|
/// interpolation_ and it kicks ass too, but a bit less than cubic.
|
||||||
Bezier(V),
|
Bezier(V),
|
||||||
|
|
||||||
/// A special Bézier interpolation using an _input tangent_ and an _output tangent_.
|
/// A special Bézier interpolation using an _input tangent_ and an _output tangent_.
|
||||||
///
|
///
|
||||||
/// With this kind of interpolation, a control point has an input tangent, which has the same role
|
/// With this kind of interpolation, a control point has an input tangent, which has the same role
|
||||||
@ -53,8 +62,6 @@ pub enum Interpolation<T, V> {
|
|||||||
///
|
///
|
||||||
/// Stroke Bézier interpolation is always a cubic Bézier interpolation by default.
|
/// Stroke Bézier interpolation is always a cubic Bézier interpolation by default.
|
||||||
StrokeBezier(V, V),
|
StrokeBezier(V, V),
|
||||||
#[doc(hidden)]
|
|
||||||
__NonExhaustive,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, V> Default for Interpolation<T, V> {
|
impl<T, V> Default for Interpolation<T, V> {
|
||||||
|
@ -179,8 +179,6 @@ impl<T, V> Spline<T, V> {
|
|||||||
|
|
||||||
Some((value, cp0, Some(cp1)))
|
Some((value, cp0, Some(cp1)))
|
||||||
}
|
}
|
||||||
|
|
||||||
Interpolation::__NonExhaustive => unreachable!(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user