Fix examples.

This commit is contained in:
Dimitri Sabadie 2019-10-22 13:25:55 +02:00
parent 22e75c6901
commit 955050ecee
No known key found for this signature in database
GPG Key ID: 5F8C1C97C1D2BB61
7 changed files with 14 additions and 28 deletions

View File

@ -34,5 +34,15 @@ num-traits = { version = "0.2", optional = true }
serde = { version = "1", optional = true } serde = { version = "1", optional = true }
serde_derive = { version = "1", optional = true } serde_derive = { version = "1", optional = true }
[dev-dependencies]
serde_json = "1"
[package.metadata.docs.rs] [package.metadata.docs.rs]
all-features = true all-features = true
[[example]]
name = "hello-world"
[[example]]
name = "serialization"
required-features = ["serialization"]

View File

@ -1,7 +0,0 @@
[package]
name = "hello-world"
version = "0.2.0"
authors = ["Dimitri Sabadie <dimitri.sabadie@gmail.com>"]
[dependencies]
splines = "1.0.0-rc.2"

View File

@ -1,8 +0,0 @@
[package]
name = "serialization"
version = "0.2.0"
authors = ["Dimitri Sabadie <dimitri.sabadie@gmail.com>"]
[dependencies]
serde_json = "1"
splines = { version = "1.0.0-rc.2", features = ["serialization"] }

View File

@ -1,9 +0,0 @@
[workspace]
members = [
"01-hello-world",
"02-serialization"
]
[patch.crates-io]
splines = { path = ".." }

View File

@ -1,7 +1,7 @@
use splines::{Interpolation, Key, Spline}; use splines::{Interpolation, Key, Spline};
#[cfg(feature = "impl-cgmath")] use cgmath as cg; #[cfg(feature = "cgmath")] use cgmath as cg;
#[cfg(feature = "impl-nalgebra")] use nalgebra as na; #[cfg(feature = "nalgebra")] use nalgebra as na;
#[test] #[test]
fn step_interpolation_f32() { fn step_interpolation_f32() {
@ -149,7 +149,7 @@ fn several_interpolations_several_keys() {
assert_eq!(spline.clamped_sample(11.), Some(4.)); assert_eq!(spline.clamped_sample(11.), Some(4.));
} }
#[cfg(feature = "impl-cgmath")] #[cfg(feature = "cgmath")]
#[test] #[test]
fn cgmath_vector_interpolation() { fn cgmath_vector_interpolation() {
use splines::Interpolate; use splines::Interpolate;
@ -163,7 +163,7 @@ fn cgmath_vector_interpolation() {
assert_eq!(Interpolate::lerp(start, end, 0.5), mid); assert_eq!(Interpolate::lerp(start, end, 0.5), mid);
} }
#[cfg(feature = "impl-nalgebra")] #[cfg(feature = "nalgebra")]
#[test] #[test]
fn nalgebra_vector_interpolation() { fn nalgebra_vector_interpolation() {
use splines::Interpolate; use splines::Interpolate;