File tree 1 file changed +11
-11
lines changed
1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ fn main() {
67
67
}
68
68
69
69
fn run ( i : & str ) {
70
- let points: HashMap < Point , usize > = HashMap :: new ( ) ;
70
+ let mut points: HashMap < Point , usize > = HashMap :: new ( ) ;
71
71
72
72
let lines: Vec < Line > = i
73
73
. lines ( )
@@ -78,15 +78,15 @@ fn run(i: &str) {
78
78
79
79
for line in lines {
80
80
println ! ( "{:?}" , line) ;
81
- println ! ( "{:?}" , line. cast( ) ) ;
82
-
83
- line
84
- . cast ( )
85
- . for_each ( |point| {
86
- match points. get ( point) {
87
- Some ( count) => points. insert ( * point, count+1 ) ,
88
- None => points. insert ( * point, 1 ) ,
89
- } ;
90
- } ) ;
81
+ //println!("{:?}", line.cast());
82
+
83
+ for point in line. cast ( ) {
84
+ match points. get ( & point) {
85
+ Some ( count) => points. insert ( point, count+1 ) ,
86
+ None => points. insert ( point, 1 ) ,
87
+ } ;
88
+ } ;
91
89
}
90
+
91
+ println ! ( "{:?}" , points) ;
92
92
}
You can’t perform that action at this time.
0 commit comments