Skip to content

Commit 57c5588

Browse files
committed
ch12 入出力プロジェクト: コマンドラインプログラムを構築するの和訳を最新版に更新
rust-lang/book@19c40bf
1 parent fff91f0 commit 57c5588

File tree

125 files changed

+1129
-1594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1129
-1594
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "minigrep"
33
version = "0.1.0"
4-
authors = ["Your Name <you@example.com>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
[dependencies]

listings/ch12-an-io-project/listing-12-01/output.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ $ cargo run
22
Compiling minigrep v0.1.0 (file:///projects/minigrep)
33
Finished dev [unoptimized + debuginfo] target(s) in 0.61s
44
Running `target/debug/minigrep`
5-
["target/debug/minigrep"]
5+
[src/main.rs:5:5] args = [
6+
"target/debug/minigrep",
7+
]

listings/ch12-an-io-project/listing-12-01/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ use std::env;
22

33
fn main() {
44
let args: Vec<String> = env::args().collect();
5-
println!("{:?}", args);
5+
dbg!(args);
66
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "minigrep"
33
version = "0.1.0"
4-
authors = ["Your Name <you@example.com>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
[dependencies]

listings/ch12-an-io-project/listing-12-02/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$ cargo run test sample.txt
1+
$ cargo run -- test sample.txt
22
Compiling minigrep v0.1.0 (file:///projects/minigrep)
33
Finished dev [unoptimized + debuginfo] target(s) in 0.0s
44
Running `target/debug/minigrep test sample.txt`

listings/ch12-an-io-project/listing-12-02/src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ fn main() {
44
let args: Vec<String> = env::args().collect();
55

66
let query = &args[1];
7-
let filename = &args[2];
7+
let file_path = &args[2];
88

9+
// "{}を検索します"
910
println!("Searching for {}", query);
10-
println!("In file {}", filename);
11+
// "ファイル{}の中で"
12+
println!("In file {}", file_path);
1113
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "minigrep"
33
version = "0.1.0"
4-
authors = ["Your Name <you@example.com>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
[dependencies]

listings/ch12-an-io-project/listing-12-03/poem.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Im nobody! Who are you?
1+
I'm nobody! Who are you?
22
Are you nobody, too?
3-
Then theres a pair of us - dont tell!
4-
Theyd banish us, you know.
3+
Then there's a pair of us - don't tell!
4+
They'd banish us, you know.
55

66
How dreary to be somebody!
77
How public, like a frog

listings/ch12-an-io-project/listing-12-03/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ fn main() {
44
let args: Vec<String> = env::args().collect();
55

66
let query = &args[1];
7-
let filename = &args[2];
7+
let file_path = &args[2];
88

99
println!("Searching for {}", query);
10-
println!("In file {}", filename);
10+
println!("In file {}", file_path);
1111
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[package]
22
name = "minigrep"
33
version = "0.1.0"
4-
authors = ["Your Name <you@example.com>"]
5-
edition = "2018"
4+
edition = "2021"
65

76
[dependencies]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy