Skip to content

Commit 29c6d2c

Browse files
trustfarm-devrinthel
authored andcommitted
Update ch02-00-guessing-game-tutorial.md (rust-lang#180)
io.std.results 등의 standard crate 참조 url 수정. rust-lang#2
1 parent 15b1f2c commit 29c6d2c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

second-edition/src/ch02-00-guessing-game-tutorial.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ use std::io;
106106
명시적으로 그 타입을 가져와야 합니다. `std::io`는 사용자의 입력을 받는 것을
107107
포함하여 `io`와 관련된 기능들을 제공합니다.
108108

109-
[prelude]: ../../std/prelude/index.html
109+
[prelude]:https://doc.rust-lang.org/std/prelude/index.html
110110

111111
1장에서 보았듯이 `main` 함수는 프로그램의 진입점입니다.
112112

@@ -159,7 +159,7 @@ let mut bar = 5; // mutable
159159
새로운 `String` 인스턴스가 묶이는 대상이 됩니다. [`String`][string]<!-- ignore -->
160160
표준 라이브러리에서 제공하는 확장 가능한(growable) UTF-8 인코딩의 문자열 타입입니다.
161161

162-
[string]: ../../std/string/struct.String.html
162+
[string]: https://doc.rust-lang.org/std/string/struct.String.html
163163

164164
`::new`에 있는 `::``new``String` 타입의 *연관함수* 임을 나타냅니다. 연관함수는
165165
하나의 타입을 위한 함수이며, 이 경우에는 하나의 `String` 인스턴스가 아니라 `String`
@@ -183,13 +183,13 @@ io::stdin().read_line(&mut guess)
183183
합니다. `stdin` 함수는 터미널의 표준 입력의 핸들(handle)의 타입인 [`std::io::Stdin`][iostdin]<!-- ignore -->
184184
인스턴스를 돌려줍니다.
185185

186-
[iostdin]: ../../std/io/struct.Stdin.html
186+
[iostdin]: https://doc.rust-lang.org/std/io/struct.Stdin.html
187187

188188
코드의 다음 부분인 `.read_line(&mut guess)`는 사용자로부터 입력을 받기 위해 표준
189189
입력 핸들에서 `.read_line(&mut guess)` 메소드를 호출합니다. 또한 `read_line``&mut guess`
190190
를 인자로 하나 넘깁니다.
191191

192-
[read_line]: ../../std/io/struct.Stdin.html#method.read_line
192+
[read_line]: https://doc.rust-lang.org/std/io/struct.Stdin.html#method.read_line
193193

194194
`read_line`은 사용자가 표준 입력에 입력할 때마다 입력된 문자들을 하나의 문자열에 저장하므로
195195
인자로 값을 저장할 문자열이 필요합니다. 그 문자열 인자는 사용자 입력을 추가하면서 변경되므로
@@ -226,8 +226,8 @@ io::stdin().read_line(&mut guess).expect("Failed to read line");
226226
입니다. 러스트는 표준 라이브러리에 여러 종류의 `Result` 타입을 가지고 있습니다.
227227
제네릭 [`Result`][result]<!-- ignore -->이나 `io:Result`가 그 예시입니다.
228228

229-
[ioresult]: ../../std/io/type.Result.html
230-
[result]: ../../std/result/enum.Result.html
229+
[ioresult]: https://doc.rust-lang.org/std/io/type.Result.html
230+
[result]: https://doc.rust-lang.org/std/result/enum.Result.html
231231

232232
`Result` 타입은 [*열거형(enumerations)*][enums]<!-- ignore -->로써 *enums* 라고 부르기도
233233
합니다. 열거형은 정해진 값들만을 가질 수 있으며 이러한 값들은 열거형의 *variants*
@@ -248,7 +248,7 @@ io::stdin().read_line(&mut guess).expect("Failed to read line");
248248
결과값을 돌려주어 사용할 수 있도록 합니다. 이 경우 결과값은 사용자가 표준 입력으로 입력했던
249249
바이트의 개수입니다.
250250

251-
[expect]: ../../std/result/enum.Result.html#method.expect
251+
[expect]: https://doc.rust-lang.org/std/result/enum.Result.html#method.expect
252252

253253
만약 `expect`를 호출하지 않는다면 컴파일은 되지만 경고가 나타납니다.
254254

@@ -712,7 +712,7 @@ Shadowing은 우리들이 `guess_str`과 `guess`처럼 고유의 변수명을
712712
`secret_number`와의 비교는 러스트가 `secret_number`의 타입을 `u32`로 유추해야
713713
함을 의미합니다. 이제 이 비교는 같은 타입의 두 값의 비교가 됩니다.
714714

715-
[parse]: ../../std/primitive.str.html#method.parse
715+
[parse]: https://doc.rust-lang.org/std/primitive.str.html#method.parse
716716

717717
`parse` 메소드의 호출은 에러가 발생하기 쉽습니다. 만약 `A👍%`과 같은 문자열이
718718
포함되어 있다면 정수로 바꿀 방법이 없습니다. "Result 타입으로 잠재된 실패 다루기"에서

0 commit comments

Comments
 (0)