@@ -11,7 +11,7 @@ fn assert_min_max_count<T: Counter, B: Borrow<Histogram<T>>>(hist: B) {
1111 let mut min = None ;
1212 let mut max = None ;
1313 let mut total = 0 ;
14- for i in 0 ..h. len ( ) {
14+ for i in 0 ..h. distinct_values ( ) {
1515 let value = h. value_for ( i) ;
1616 let count = h. count_at ( value) ;
1717 if count == T :: zero ( ) {
@@ -28,7 +28,7 @@ fn assert_min_max_count<T: Counter, B: Borrow<Histogram<T>>>(hist: B) {
2828
2929 assert_eq ! ( min, h. min( ) ) ;
3030 assert_eq ! ( max, h. max( ) ) ;
31- assert_eq ! ( total, h. count ( ) ) ;
31+ assert_eq ! ( total, h. len ( ) ) ;
3232}
3333
3434#[ test]
@@ -44,17 +44,17 @@ fn subtract_after_add() {
4444 h1. add ( & h2) . unwrap ( ) ;
4545 assert_eq ! ( h1. count_at( TEST_VALUE_LEVEL ) , 2 ) ;
4646 assert_eq ! ( h1. count_at( 1000 * TEST_VALUE_LEVEL ) , 2 ) ;
47- assert_eq ! ( h1. count ( ) , 4 ) ;
47+ assert_eq ! ( h1. len ( ) , 4 ) ;
4848
4949 h1 += & h2;
5050 assert_eq ! ( h1. count_at( TEST_VALUE_LEVEL ) , 3 ) ;
5151 assert_eq ! ( h1. count_at( 1000 * TEST_VALUE_LEVEL ) , 3 ) ;
52- assert_eq ! ( h1. count ( ) , 6 ) ;
52+ assert_eq ! ( h1. len ( ) , 6 ) ;
5353
5454 h1. subtract ( & h2) . unwrap ( ) ;
5555 assert_eq ! ( h1. count_at( TEST_VALUE_LEVEL ) , 2 ) ;
5656 assert_eq ! ( h1. count_at( 1000 * TEST_VALUE_LEVEL ) , 2 ) ;
57- assert_eq ! ( h1. count ( ) , 4 ) ;
57+ assert_eq ! ( h1. len ( ) , 4 ) ;
5858
5959 assert_min_max_count ( h1) ;
6060 assert_min_max_count ( h2) ;
@@ -69,13 +69,13 @@ fn subtract_to_zero_counts() {
6969
7070 assert_eq ! ( h1. count_at( TEST_VALUE_LEVEL ) , 1 ) ;
7171 assert_eq ! ( h1. count_at( 1000 * TEST_VALUE_LEVEL ) , 1 ) ;
72- assert_eq ! ( h1. count ( ) , 2 ) ;
72+ assert_eq ! ( h1. len ( ) , 2 ) ;
7373
7474 let clone = h1. clone ( ) ;
7575 h1. subtract ( & clone) . unwrap ( ) ;
7676 assert_eq ! ( h1. count_at( TEST_VALUE_LEVEL ) , 0 ) ;
7777 assert_eq ! ( h1. count_at( 1000 * TEST_VALUE_LEVEL ) , 0 ) ;
78- assert_eq ! ( h1. count ( ) , 0 ) ;
78+ assert_eq ! ( h1. len ( ) , 0 ) ;
7979
8080 assert_min_max_count ( h1) ;
8181}
@@ -141,14 +141,14 @@ fn subtract_values_inside_minuend_range_works() {
141141 assert_eq ! ( big. count_at( TEST_VALUE_LEVEL ) , 3 ) ;
142142 assert_eq ! ( big. count_at( 1000 * TEST_VALUE_LEVEL ) , 3 ) ;
143143 assert_eq ! ( big. count_at( 2 * max) , 3 ) ; // overflow smaller hist...
144- assert_eq ! ( big. count ( ) , 9 ) ;
144+ assert_eq ! ( big. len ( ) , 9 ) ;
145145
146146 // Subtracting the smaller histogram from the bigger one should work:
147147 big -= & h1;
148148 assert_eq ! ( big. count_at( TEST_VALUE_LEVEL ) , 2 ) ;
149149 assert_eq ! ( big. count_at( 1000 * TEST_VALUE_LEVEL ) , 2 ) ;
150150 assert_eq ! ( big. count_at( 2 * max) , 3 ) ; // overflow smaller hist...
151- assert_eq ! ( big. count ( ) , 7 ) ;
151+ assert_eq ! ( big. len ( ) , 7 ) ;
152152
153153 assert_min_max_count ( h1) ;
154154 assert_min_max_count ( big) ;
@@ -172,7 +172,7 @@ fn subtract_values_strictly_inside_minuend_range_yields_same_min_max_no_restat()
172172
173173 assert_eq ! ( 1 , h1. min( ) ) ;
174174 assert_eq ! ( 1000 , h1. max( ) ) ;
175- assert_eq ! ( 2 , h1. count ( ) ) ;
175+ assert_eq ! ( 2 , h1. len ( ) ) ;
176176
177177 assert_min_max_count ( h1) ;
178178 assert_min_max_count ( h2) ;
@@ -340,7 +340,7 @@ fn subtract_values_minuend_saturated_total_recalculates_saturated() {
340340 assert_eq ! ( 1 , h1. min( ) ) ;
341341 assert_eq ! ( 1000 , h1. max( ) ) ;
342342 // still saturated
343- assert_eq ! ( u64 :: max_value( ) , h1. count ( ) ) ;
343+ assert_eq ! ( u64 :: max_value( ) , h1. len ( ) ) ;
344344
345345 assert_min_max_count ( h1) ;
346346 assert_min_max_count ( h2) ;
@@ -368,7 +368,7 @@ fn subtract_values_minuend_saturated_total_recalculates_not_saturated() {
368368 assert_eq ! ( 1 , h1. min( ) ) ;
369369 assert_eq ! ( 1000 , h1. max( ) ) ;
370370 // not saturated
371- assert_eq ! ( u64 :: max_value( ) / 16 * 15 , h1. count ( ) ) ;
371+ assert_eq ! ( u64 :: max_value( ) / 16 * 15 , h1. len ( ) ) ;
372372
373373 assert_min_max_count ( h1) ;
374374 assert_min_max_count ( h2) ;
0 commit comments