/rust/registry/src/index.crates.io-1949cf8c6b5b557f/roaring-0.11.3/src/treemap/fmt.rs
Line | Count | Source |
1 | | use core::fmt; |
2 | | |
3 | | use crate::RoaringTreemap; |
4 | | |
5 | | #[cfg(not(feature = "std"))] |
6 | | use alloc::vec::Vec; |
7 | | |
8 | | impl fmt::Debug for RoaringTreemap { |
9 | 0 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |
10 | 0 | if self.len() < 16 { |
11 | 0 | write!(f, "RoaringTreemap<{:?}>", self.iter().collect::<Vec<u64>>()) |
12 | | } else { |
13 | 0 | write!( |
14 | 0 | f, |
15 | | "RoaringTreemap<{:?} values between {:?} and {:?}>", |
16 | 0 | self.len(), |
17 | 0 | self.min().unwrap(), |
18 | 0 | self.max().unwrap() |
19 | | ) |
20 | | } |
21 | 0 | } |
22 | | } |