@@ -29,7 +29,7 @@ fn tick_offset_map(axis: &axis::ContinuousAxis, face_width: u32) -> HashMap<i32,
2929/// Given a histogram object,
3030/// the total scale of the axis
3131/// and the number of face cells to work with,
32- /// create a mapping of cell offset to bin bound
32+ /// return which cells will contain a bin bound
3333fn bound_cell_offsets (
3434 hist : & repr:: Histogram ,
3535 x_axis : & axis:: ContinuousAxis ,
@@ -60,24 +60,24 @@ fn bins_for_cells(bound_cell_offsets: &[i32], face_width: u32) -> Vec<Option<i32
6060 }
6161 cell_bins. push ( None ) ; // end with an appended positive null
6262
63- if * bins_cell_offset < 0 {
63+ if * bins_cell_offset <= 0 {
6464 cell_bins = cell_bins
6565 . iter ( )
6666 . skip ( bins_cell_offset. wrapping_abs ( ) as usize )
6767 . cloned ( )
6868 . collect ( ) ;
69- } else if * bins_cell_offset > 0 {
69+ } else {
7070 let mut new_bins = vec ! [ None ; ( * bins_cell_offset) as usize ] ;
7171 new_bins. extend ( cell_bins. iter ( ) ) ;
7272 cell_bins = new_bins;
7373 }
7474
75- if cell_bins. len ( ) < face_width as usize + 2 {
75+ if cell_bins. len ( ) <= face_width as usize + 2 {
7676 let deficit = face_width as usize + 2 - cell_bins. len ( ) ;
7777 let mut new_bins = cell_bins;
7878 new_bins. extend ( vec ! [ None ; deficit] . iter ( ) ) ;
7979 cell_bins = new_bins;
80- } else if cell_bins . len ( ) > face_width as usize + 2 {
80+ } else {
8181 let new_bins = cell_bins;
8282 cell_bins = new_bins
8383 . iter ( )
@@ -429,7 +429,7 @@ pub fn overlay(under: &str, over: &str, x: i32, y: i32) -> String {
429429 let new_lines: Vec < String > = ( 0 ..lines_deficit)
430430 . map ( |_| ( 0 ..over_width) . map ( |_| ' ' ) . collect :: < String > ( ) )
431431 . collect ( ) ;
432- let mut temp = split_over. clone ( ) ;
432+ let mut temp = split_over;
433433 for new_line in new_lines {
434434 temp. push ( new_line) ;
435435 }
@@ -616,7 +616,6 @@ mod tests {
616616
617617 #[ test]
618618 fn test_render_face_points ( ) {
619- use crate :: repr;
620619 use crate :: style:: PointStyle ;
621620 let data = vec ! [
622621 ( -3.0 , 2.3 ) ,
0 commit comments