Add rustfmt.toml and reformat.
This commit is contained in:
parent
1bcf1de99e
commit
89dfb61272
15
rustfmt.toml
Normal file
15
rustfmt.toml
Normal file
@ -0,0 +1,15 @@
|
||||
edition = "2018"
|
||||
|
||||
fn_args_layout = "Tall"
|
||||
force_explicit_abi = true
|
||||
hard_tabs = false
|
||||
max_width = 100
|
||||
merge_derives = true
|
||||
newline_style = "Unix"
|
||||
remove_nested_parens = true
|
||||
reorder_imports = true
|
||||
reorder_modules = true
|
||||
tab_spaces = 2
|
||||
use_field_init_shorthand = true
|
||||
use_small_heuristics = "Default"
|
||||
use_try_shorthand = true
|
@ -262,13 +262,7 @@ macro_rules! impl_interpolate_simple {
|
||||
a * (1. - t) + b * t
|
||||
}
|
||||
|
||||
fn cubic_hermite(
|
||||
x: (Self, $t),
|
||||
a: (Self, $t),
|
||||
b: (Self, $t),
|
||||
y: (Self, $t),
|
||||
t: $t,
|
||||
) -> Self {
|
||||
fn cubic_hermite(x: (Self, $t), a: (Self, $t), b: (Self, $t), y: (Self, $t), t: $t) -> Self {
|
||||
cubic_hermite_def(x, a, b, y, t)
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,8 @@ impl<T, V> Spline<T, V> {
|
||||
where
|
||||
T: PartialOrd,
|
||||
{
|
||||
self.0
|
||||
self
|
||||
.0
|
||||
.sort_by(|k0, k1| k0.t.partial_cmp(&k1.t).unwrap_or(Ordering::Less));
|
||||
}
|
||||
|
||||
@ -165,13 +166,9 @@ impl<T, V> Spline<T, V> {
|
||||
let nt = normalize_time(t, cp0, cp1);
|
||||
|
||||
let value = match cp1.interpolation {
|
||||
Interpolation::Bezier(v) => Interpolate::cubic_bezier(
|
||||
cp0.value,
|
||||
u,
|
||||
cp1.value + cp1.value - v,
|
||||
cp1.value,
|
||||
nt,
|
||||
),
|
||||
Interpolation::Bezier(v) => {
|
||||
Interpolate::cubic_bezier(cp0.value, u, cp1.value + cp1.value - v, cp1.value, nt)
|
||||
}
|
||||
|
||||
Interpolation::StrokeBezier(v, _) => {
|
||||
Interpolate::cubic_bezier(cp0.value, u, v, cp1.value, nt)
|
||||
|
Loading…
Reference in New Issue
Block a user