File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change
1
+ I'm nobody! Who are you?
2
+ Are you nobody, too?
3
+ Then there's a pair of us - don't tell!
4
+ They'd banish us, you know.
5
+
6
+ How dreary to be somebody!
7
+ How public, like a frog
8
+ To tell your name the livelong day
9
+ To an admiring bog!
Original file line number Diff line number Diff line change 1
- use std:: env;
1
+ use std:: { env, fs } ;
2
2
3
3
fn main ( ) {
4
4
let args: Vec < String > = env:: args ( ) . collect ( ) ;
@@ -7,5 +7,10 @@ fn main() {
7
7
let file_path = & args[ 2 ] ;
8
8
9
9
println ! ( "Searching for {}" , query) ;
10
- println ! ( "In file {}" , file_path) ;
10
+ println ! ( "In file {}\n " , file_path) ;
11
+
12
+ let contents = fs:: read_to_string ( file_path)
13
+ . expect ( "Should be able to read the file!" ) ;
14
+
15
+ println ! ( "With text contents:\n {}" , contents) ;
11
16
}
You can’t perform that action at this time.
0 commit comments