File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed
Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -83,11 +83,7 @@ impl Beam {
8383 let start = self . line . start ( ) ;
8484 let end = self . line . end ( ) ;
8585
86- if start. x != other_start. x {
87- return false ;
88- }
89-
90- start. y <= other_start. y && end. y >= other_start. y
86+ start. x == other_start. x && ( start. y ..=end. y ) . contains ( & other_start. y )
9187 }
9288
9389 fn down ( & self ) -> Self {
@@ -130,7 +126,7 @@ impl Display for Beam {
130126impl PrintableOnGrid for Beam {
131127 type Cell = char ;
132128
133- fn print_on_grid ( & self , grid : & mut Grid < char > ) {
129+ fn print ( & self , grid : & mut Grid < char > ) {
134130 let mut current = self . line . start ( ) ;
135131
136132 loop {
Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ where
367367 where
368368 P : PrintableOnGrid < Cell = T > + ?Sized ,
369369 {
370- printable. print_on_grid ( self )
370+ printable. print ( self )
371371 }
372372}
373373
@@ -413,17 +413,17 @@ where
413413
414414pub trait PrintableOnGrid {
415415 type Cell ;
416- fn print_on_grid ( & self , grid : & mut Grid < Self :: Cell > ) ;
416+ fn print ( & self , grid : & mut Grid < Self :: Cell > ) ;
417417}
418418
419419impl < U > PrintableOnGrid for [ U ]
420420where
421421 U : PrintableOnGrid ,
422422{
423423 type Cell = U :: Cell ;
424- fn print_on_grid ( & self , grid : & mut Grid < Self :: Cell > ) {
424+ fn print ( & self , grid : & mut Grid < Self :: Cell > ) {
425425 for item in self {
426- item. print_on_grid ( grid) ;
426+ item. print ( grid) ;
427427 }
428428 }
429429}
You can’t perform that action at this time.
0 commit comments