From b66858af521954dc3be0716f7b79cb8688536076 Mon Sep 17 00:00:00 2001 From: Rinthel Date: Tue, 8 Aug 2023 22:32:10 +0900 Subject: [PATCH] translate missed comments / text --- .../no-listing-01-can-mutate-string/src/main.rs | 4 ++-- .../no-listing-02-string-scope/src/main.rs | 8 ++++---- .../listing-07-03/src/lib.rs | 4 ++-- .../listing-07-05/src/lib.rs | 4 ++-- .../listing-07-07/src/lib.rs | 4 ++-- .../tests/common.rs | 2 +- .../ch16-fearless-concurrency/listing-16-04/src/main.rs | 2 +- .../output-only-01-move-drop/output.txt | 2 +- .../ch18-patterns-and-matching/listing-18-06/src/main.rs | 2 +- listings/ch19-advanced-features/listing-19-11/src/main.rs | 4 ++-- .../hello_macro/hello_macro_derive/src/lib.rs | 6 +++--- src/ch03-04-comments.md | 6 +++--- src/ch15-06-reference-cycles.md | 4 ++-- src/ch18-03-pattern-syntax.md | 2 +- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs b/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs index b68f0f1e78..e23dd336cb 100644 --- a/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs +++ b/listings/ch04-understanding-ownership/no-listing-01-can-mutate-string/src/main.rs @@ -2,8 +2,8 @@ fn main() { // ANCHOR: here let mut s = String::from("hello"); - s.push_str(", world!"); // push_str() appends a literal to a String + s.push_str(", world!"); // push_str()이 문자열에 리터럴을 추가합니다 - println!("{}", s); // This will print `hello, world!` + println!("{}", s); // 이 줄이 `hello, world!`를 출력합니다 // ANCHOR_END: here } diff --git a/listings/ch04-understanding-ownership/no-listing-02-string-scope/src/main.rs b/listings/ch04-understanding-ownership/no-listing-02-string-scope/src/main.rs index 7e6d46f836..9a129f7df1 100644 --- a/listings/ch04-understanding-ownership/no-listing-02-string-scope/src/main.rs +++ b/listings/ch04-understanding-ownership/no-listing-02-string-scope/src/main.rs @@ -1,10 +1,10 @@ fn main() { // ANCHOR: here { - let s = String::from("hello"); // s is valid from this point forward + let s = String::from("hello"); // s는 이 지점부터 유효합니다 - // do stuff with s - } // this scope is now over, and s is no - // longer valid + // s를 가지고 무언가 합니다 + } // 이 스코프가 종료되었고, s는 더 이상 + // 유효하지 않습니다. // ANCHOR_END: here } diff --git a/listings/ch07-managing-growing-projects/listing-07-03/src/lib.rs b/listings/ch07-managing-growing-projects/listing-07-03/src/lib.rs index 0b8a43c6b3..c8181e6a17 100644 --- a/listings/ch07-managing-growing-projects/listing-07-03/src/lib.rs +++ b/listings/ch07-managing-growing-projects/listing-07-03/src/lib.rs @@ -5,9 +5,9 @@ mod front_of_house { } pub fn eat_at_restaurant() { - // Absolute path + // 절대 경로 crate::front_of_house::hosting::add_to_waitlist(); - // Relative path + // 상대 경로 front_of_house::hosting::add_to_waitlist(); } diff --git a/listings/ch07-managing-growing-projects/listing-07-05/src/lib.rs b/listings/ch07-managing-growing-projects/listing-07-05/src/lib.rs index 05372dbe5e..3373493a36 100644 --- a/listings/ch07-managing-growing-projects/listing-07-05/src/lib.rs +++ b/listings/ch07-managing-growing-projects/listing-07-05/src/lib.rs @@ -5,9 +5,9 @@ mod front_of_house { } pub fn eat_at_restaurant() { - // Absolute path + // 절대 경로 crate::front_of_house::hosting::add_to_waitlist(); - // Relative path + // 상대 경로 front_of_house::hosting::add_to_waitlist(); } diff --git a/listings/ch07-managing-growing-projects/listing-07-07/src/lib.rs b/listings/ch07-managing-growing-projects/listing-07-07/src/lib.rs index 7b89ee7cd2..333fb9491e 100644 --- a/listings/ch07-managing-growing-projects/listing-07-07/src/lib.rs +++ b/listings/ch07-managing-growing-projects/listing-07-07/src/lib.rs @@ -5,9 +5,9 @@ mod front_of_house { } pub fn eat_at_restaurant() { - // Absolute path + // 절대 경로 crate::front_of_house::hosting::add_to_waitlist(); - // Relative path + // 상대 경로 front_of_house::hosting::add_to_waitlist(); } diff --git a/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/tests/common.rs b/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/tests/common.rs index 5fb7a390a6..fe74717fde 100644 --- a/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/tests/common.rs +++ b/listings/ch11-writing-automated-tests/no-listing-12-shared-test-code-problem/tests/common.rs @@ -1,3 +1,3 @@ pub fn setup() { - // setup code specific to your library's tests would go here + // 여기에 라이브러리 테스트와 관련된 설정 코드를 작성하려고 합니다 } diff --git a/listings/ch16-fearless-concurrency/listing-16-04/src/main.rs b/listings/ch16-fearless-concurrency/listing-16-04/src/main.rs index 0bccc5f56f..29dc6831e7 100644 --- a/listings/ch16-fearless-concurrency/listing-16-04/src/main.rs +++ b/listings/ch16-fearless-concurrency/listing-16-04/src/main.rs @@ -7,7 +7,7 @@ fn main() { println!("Here's a vector: {:?}", v); }); - drop(v); // oh no! + drop(v); // 오, 이런! handle.join().unwrap(); } diff --git a/listings/ch16-fearless-concurrency/output-only-01-move-drop/output.txt b/listings/ch16-fearless-concurrency/output-only-01-move-drop/output.txt index 301a9a44a4..5eb9aa1c68 100644 --- a/listings/ch16-fearless-concurrency/output-only-01-move-drop/output.txt +++ b/listings/ch16-fearless-concurrency/output-only-01-move-drop/output.txt @@ -11,7 +11,7 @@ error[E0382]: use of moved value: `v` 7 | println!("Here's a vector: {:?}", v); | - variable moved due to use in closure ... -10 | drop(v); // oh no! +10 | drop(v); // 오, 이런! | ^ value used here after move For more information about this error, try `rustc --explain E0382`. diff --git a/listings/ch18-patterns-and-matching/listing-18-06/src/main.rs b/listings/ch18-patterns-and-matching/listing-18-06/src/main.rs index c5d71e6c13..3ea434af91 100644 --- a/listings/ch18-patterns-and-matching/listing-18-06/src/main.rs +++ b/listings/ch18-patterns-and-matching/listing-18-06/src/main.rs @@ -1,6 +1,6 @@ // ANCHOR: here fn foo(x: i32) { - // code goes here + // 여기에 코드를 작성합니다 } // ANCHOR_END: here diff --git a/listings/ch19-advanced-features/listing-19-11/src/main.rs b/listings/ch19-advanced-features/listing-19-11/src/main.rs index 885c1aa1d8..0db6cdd7da 100644 --- a/listings/ch19-advanced-features/listing-19-11/src/main.rs +++ b/listings/ch19-advanced-features/listing-19-11/src/main.rs @@ -1,9 +1,9 @@ unsafe trait Foo { - // methods go here + // 여기에 메소드가 작성됩니다 } unsafe impl Foo for i32 { - // method implementations go here + // 여기에 메소드 구현이 작성됩니다 } fn main() {} diff --git a/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/src/lib.rs b/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/src/lib.rs index 11643a8d62..e32af1cf98 100644 --- a/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/src/lib.rs +++ b/listings/ch19-advanced-features/listing-19-31/hello_macro/hello_macro_derive/src/lib.rs @@ -4,10 +4,10 @@ use syn; #[proc_macro_derive(HelloMacro)] pub fn hello_macro_derive(input: TokenStream) -> TokenStream { - // Construct a representation of Rust code as a syntax tree - // that we can manipulate + // 조작 가능한 구문 트리로 러스트 코드의 표현을 + // 구성합니다 let ast = syn::parse(input).unwrap(); - // Build the trait implementation + // 트레이트 구현체를 생성합니다 impl_hello_macro(&ast) } diff --git a/src/ch03-04-comments.md b/src/ch03-04-comments.md index 981665a04e..b756ce1589 100644 --- a/src/ch03-04-comments.md +++ b/src/ch03-04-comments.md @@ -16,9 +16,9 @@ 주석의 경우에는 아래처럼 각 줄마다 `//`를 추가하면 됩니다: ```rust -// So we’re doing something complicated here, long enough that we need -// multiple lines of comments to do it! Whew! Hopefully, this comment will -// explain what’s going on. +// 그래서 여기서는 여러 줄의 주석을 달 필요가 있을 정도로 +// 복잡한 작업을 하고 있습니다! 휴우! 이 주석으로 무슨 일이 +// 일어나고 있는지 설명할 수 있기를 바랍니다. ``` 또한 주석은 코드의 뒷 부분에 위치할 수도 있습니다: diff --git a/src/ch15-06-reference-cycles.md b/src/ch15-06-reference-cycles.md index 160e328de4..1ea25964d5 100644 --- a/src/ch15-06-reference-cycles.md +++ b/src/ch15-06-reference-cycles.md @@ -266,8 +266,8 @@ children: RefCell { value: [] } }] } }) {{#rustdoc_include ../listings/ch15-smart-pointers/listing-15-29/src/main.rs:here}} ``` -예제 15-29: Creating `branch` in an inner scope and -examining strong and weak reference counts +예제 15-29: 내부 스코프에서 `branch`를 만들고 +강한 참조 카운트와 약한 참조 카운트 시험하기 `leaf`가 생성된 다음, 이것의 `Rc`는 강한 참조 카운트 1개와 약한 참조 카운트 0개를 갖습니다. 내부 스코프에서 `branch`를 만들고 `leaf`와 연관짓게 되는데, diff --git a/src/ch18-03-pattern-syntax.md b/src/ch18-03-pattern-syntax.md index 30b721dd09..bcad085bfa 100644 --- a/src/ch18-03-pattern-syntax.md +++ b/src/ch18-03-pattern-syntax.md @@ -535,7 +535,7 @@ RGB 및 HSV 색상을 지원할 수 있습니다. (4 | 5 | 6) if y => ... ``` -rather than this: +이런 식이 아니고요: ```text 4 | 5 | (6 if y) => ...