Skip to content

ch13 関数型言語の機能: イテレータとクロージャの和訳を最新版に更新 #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 36 commits into
base: master-ja
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e685c96
ch02 数当てゲームのプログラミングの和訳を最新版に更新
shinmili May 26, 2024
db3a649
リンク漏れ修正
shinmili Nov 28, 2024
24f5af0
コメントの位置修正
shinmili Dec 26, 2024
cf8947f
ch03 一般的なプログラミングの概念の和訳を最新版に更新
shinmili May 26, 2024
42a63a5
リンク漏れ修正
shinmili Nov 28, 2024
e0d2a48
誤字修正
shinmili Jan 31, 2025
42cf09e
ch04 所有権を理解するの和訳を最新版に更新
shinmili May 26, 2024
138f7fc
コメント閉じ忘れ修正
shinmili Nov 28, 2024
f5f69e9
コードブロックの訳し漏れ修正
shinmili Nov 28, 2024
40d8fd5
ch05 構造体を使用して関係のあるデータを構造化するの和訳を最新版に更新
shinmili May 26, 2024
70c7a13
ch06 Enumとパターンマッチングの和訳を最新版に更新
shinmili May 26, 2024
2f70d34
ch07 肥大化していくプロジェクトをパッケージ、クレート、モジュールを利用して管理するの和訳を最新版に更新
shinmili May 26, 2024
0c0c9d5
消し忘れた段落を削除
shinmili Nov 29, 2024
9eb0aa4
読点の修正
shinmili Nov 29, 2024
1139c13
ch08 一般的なコレクションの和訳を最新版に更新
shinmili May 26, 2024
32a5e00
誤字修正
shinmili Nov 30, 2024
cbd1f9c
消し忘れた段落を削除
shinmili Nov 30, 2024
777e045
コメントの閉じ方の誤りを修正
shinmili Nov 30, 2024
6da5374
修正漏れを修正
shinmili Nov 30, 2024
75aeb75
doc.rust-lang.org 内でのみ機能する相対リンクを修正
shinmili Nov 30, 2024
93e7c99
ch09 エラー処理の和訳を最新版に更新
shinmili May 26, 2024
ee5f863
不要な記号の削除
shinmili Nov 30, 2024
1e6ccf0
消し忘れた段落を削除
shinmili Nov 30, 2024
4e664a9
コメントの位置修正
shinmili Dec 27, 2024
4e3d9ea
ch10 ジェネリック型、トレイト、ライフタイムの和訳を最新版に更新
shinmili May 26, 2024
439eeec
消し忘れた段落を削除
shinmili Nov 30, 2024
fb60cce
ch11 自動テストを書くの和訳を最新版に更新
shinmili May 26, 2024
91b9e1a
見出しレベル誤りを修正
shinmili Dec 1, 2024
059af4e
消し忘れた段落を削除
shinmili Dec 1, 2024
5464a6e
余計な空行を削除
shinmili Dec 27, 2024
06f787f
訳し漏れの翻訳を追加
shinmili Jan 31, 2025
fff91f0
誤字修正
shinmili Jan 31, 2025
57c5588
ch12 入出力プロジェクト: コマンドラインプログラムを構築するの和訳を最新版に更新
shinmili May 26, 2024
e042c99
ch13 関数型言語の機能: イテレータとクロージャの和訳を最新版に更新
shinmili May 26, 2024
4543380
見出しレベル誤りを修正
shinmili Dec 1, 2024
57b18f1
訳し忘れを修正
shinmili Dec 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ch05 構造体を使用して関係のあるデータを構造化するの和訳を最新版に更新
  • Loading branch information
shinmili committed Feb 4, 2025
commit 40d8fd51a35806e9a17ba4a1aa235d42727a8ea7
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// ANCHOR: here
struct User {
active: bool,
username: String,
email: String,
sign_in_count: u64,
active: bool,
}
// ANCHOR_END: here

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
struct User {
active: bool,
username: String,
email: String,
sign_in_count: u64,
active: bool,
}

// ANCHOR: here
fn main() {
// ANCHOR: here
let user1 = User {
email: String::from("someone@example.com"),
username: String::from("someusername123"),
active: true,
username: String::from("someusername123"),
email: String::from("someone@example.com"),
sign_in_count: 1,
};
// ANCHOR_END: here
}
// ANCHOR_END: here
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
struct User {
active: bool,
username: String,
email: String,
sign_in_count: u64,
active: bool,
}

// ANCHOR: here
fn main() {
// ANCHOR: here
let mut user1 = User {
email: String::from("someone@example.com"),
username: String::from("someusername123"),
active: true,
username: String::from("someusername123"),
email: String::from("someone@example.com"),
sign_in_count: 1,
};

user1.email = String::from("anotheremail@example.com");
// ANCHOR_END: here
}
// ANCHOR_END: here
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
struct User {
active: bool,
username: String,
email: String,
sign_in_count: u64,
active: bool,
}

// ANCHOR: here
fn build_user(email: String, username: String) -> User {
User {
email: email,
username: username,
active: true,
username: username,
email: email,
sign_in_count: 1,
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
struct User {
active: bool,
username: String,
email: String,
sign_in_count: u64,
active: bool,
}

// ANCHOR: here
fn build_user(email: String, username: String) -> User {
User {
email,
username,
active: true,
username,
email,
sign_in_count: 1,
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
struct User {
active: bool,
username: String,
email: String,
sign_in_count: u64,
active: bool,
}

// ANCHOR: here
fn main() {
// --snip--
// ANCHOR_END: here

let user1 = User {
email: String::from("someone@example.com"),
username: String::from("someusername123"),
active: true,
sign_in_count: 1,
};

// ANCHOR: here

let user2 = User {
email: String::from("another@example.com"),
username: String::from("anotherusername567"),
active: user1.active,
username: user1.username,
email: String::from("another@example.com"),
sign_in_count: user1.sign_in_count,
};
// ANCHOR_END: here
}
// ANCHOR_END: here
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
struct User {
active: bool,
username: String,
email: String,
sign_in_count: u64,
active: bool,
}

// ANCHOR: here
fn main() {
// --snip--
// ANCHOR_END: here

let user1 = User {
email: String::from("someone@example.com"),
username: String::from("someusername123"),
active: true,
sign_in_count: 1,
};

// ANCHOR: here

let user2 = User {
email: String::from("another@example.com"),
username: String::from("anotherusername567"),
..user1
};
// ANCHOR_END: here
}
// ANCHOR_END: here

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
name = "rectangles"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
$ cargo run
Compiling structs v0.1.0 (file:///projects/structs)
Compiling rectangles v0.1.0 (file:///projects/rectangles)
Finished dev [unoptimized + debuginfo] target(s) in 0.42s
Running `target/debug/structs`
Running `target/debug/rectangles`
The area of the rectangle is 1500 square pixels.
(長方形の面積は、1500平方ピクセルです)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ fn main() {
let height1 = 50;

println!(
// 長方形の面積は、{}平方ピクセルです
"The area of the rectangle is {} square pixels.",
area(width1, height1)
);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
name = "rectangles"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
name = "rectangles"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
name = "rectangles"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
$ cargo run
Compiling structs v0.1.0 (file:///projects/structs)
Compiling rectangles v0.1.0 (file:///projects/rectangles)
error[E0277]: `Rectangle` doesn't implement `std::fmt::Display`
(エラー: `Rectangle`は`std::fmt::Display`を実装していません)
--> src/main.rs:12:29
|
12 | println!("rect1 is {}", rect1);
| ^^^^^ `Rectangle` cannot be formatted with the default formatter
|
= help: the trait `std::fmt::Display` is not implemented for `Rectangle`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
= note: required by `std::fmt::Display::fmt`

error: aborting due to previous error
(ヘルプ: `std::fmt::Display`は`Rectangle`に対して実装されていません)
(注釈: フォーマット文字列では代わりに`{:?}`(またはpretty-printするためには{:#?})が使用できるかもしれません)
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
error: could not compile `structs`.

To learn more, run the command again with --verbose.
error: could not compile `rectangles` (bin "rectangles") due to 1 previous error
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ fn main() {
height: 50,
};

// rect1は{}です
println!("rect1 is {}", rect1);
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
name = "rectangles"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ cargo run
Compiling structs v0.1.0 (file:///projects/structs)
Compiling rectangles v0.1.0 (file:///projects/rectangles)
Finished dev [unoptimized + debuginfo] target(s) in 0.48s
Running `target/debug/structs`
Running `target/debug/rectangles`
rect1 is Rectangle { width: 30, height: 50 }

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "structs"
name = "rectangles"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fn main() {
};

println!(
// 長方形の面積は{}平方ピクセルです。
"The area of the rectangle is {} square pixels.",
rect1.area()
);
Expand Down
Loading
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