File tree 3 files changed +33
-0
lines changed
3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -38,4 +38,5 @@ members = [
38
38
" t250114-simple-web" ,
39
39
" t250115-simple-web-with-tokio" ,
40
40
" t250116-simple-web-multi-thread" ,
41
+ " t250117-file-read" ,
41
42
]
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " t250117-file-read"
3
+ version.workspace = true
4
+ authors.workspace = true
5
+ edition.workspace = true
6
+ license.workspace = true
7
+ readme.workspace = true
8
+ description.workspace = true
9
+ keywords.workspace = true
10
+ categories.workspace = true
11
+ homepage.workspace = true
12
+ repository.workspace = true
13
+
14
+ [dependencies ]
Original file line number Diff line number Diff line change
1
+ // use std::fs::File;
2
+ // use std::io::{self, Read};
3
+
4
+ // fn main() -> io::Result<()> {
5
+ // let mut file = File::open("README.md")?;
6
+ // let mut contents = String::new();
7
+ // file.read_to_string(&mut contents)?;
8
+ // println!("{}", contents);
9
+ // Ok(())
10
+ // }
11
+
12
+ use std:: fs;
13
+
14
+ fn main ( ) -> Result < ( ) , std:: io:: Error > {
15
+ let contents = fs:: read_to_string ( "README.md" ) ?;
16
+ println ! ( "{}" , contents) ;
17
+ Ok ( ( ) )
18
+ }
You can’t perform that action at this time.
0 commit comments