size_of/support/
ordered_float.rs

1#![cfg(feature = "ordered-float")]
2
3use crate::{Context, SizeOf};
4use ordered_float::{Float, FloatIsNan, NotNan, OrderedFloat};
5
6impl_total_size_childless! {
7    FloatIsNan,
8}
9
10impl<T> SizeOf for NotNan<T>
11where
12    // FIXME: Not a fan of the `Float` bound but I don't really have a
13    // choice
14    T: Float + SizeOf,
15{
16    #[inline]
17    fn size_of_children(&self, context: &mut Context) {
18        T::size_of_children(self, context);
19    }
20}
21
22impl<T> SizeOf for OrderedFloat<T>
23where
24    // FIXME: Not a fan of the `Float` bound but I don't really have a
25    // choice
26    T: Float + SizeOf,
27{
28    #[inline]
29    fn size_of_children(&self, context: &mut Context) {
30        T::size_of_children(self, context);
31    }
32}