1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#![cfg(feature = "ordered-float")]

use crate::{Context, SizeOf};
use ordered_float::{Float, FloatIsNan, NotNan, OrderedFloat};

impl_total_size_childless! {
    FloatIsNan,
}

impl<T> SizeOf for NotNan<T>
where
    // FIXME: Not a fan of the `Float` bound but I don't really have a
    // choice
    T: Float + SizeOf,
{
    #[inline]
    fn size_of_children(&self, context: &mut Context) {
        T::size_of_children(self, context);
    }
}

impl<T> SizeOf for OrderedFloat<T>
where
    // FIXME: Not a fan of the `Float` bound but I don't really have a
    // choice
    T: Float + SizeOf,
{
    #[inline]
    fn size_of_children(&self, context: &mut Context) {
        T::size_of_children(self, context);
    }
}