@@ -3430,38 +3430,38 @@ msgstr ""
3430
3430
3431
3431
#: src/types/cast.md:53
3432
3432
msgid "// Unless it already fits, of course.\n"
3433
- msgstr "// 当然,除非它已经适合 。\n"
3433
+ msgstr "// 当然,如果已经适合的话就不需要转换 。\n"
3434
3434
3435
3435
#: src/types/cast.md:54
3436
3436
msgid "\" 128 as a i16 is: {}\""
3437
- msgstr "\" 128 作为 i16 是:{}\""
3437
+ msgstr "\" 128 转换为 i16 是:{}\""
3438
3438
3439
3439
#: src/types/cast.md:56
3440
3440
msgid ""
3441
3441
"// In boundary case 128 value in 8-bit two's complement representation is "
3442
3442
"-128\n"
3443
- msgstr "// 在边界情况下, 128 在 8 位二进制补码表示中是 -128\n"
3443
+ msgstr "// 边界情况: 128 在 8 位二进制补码表示中为 -128\n"
3444
3444
3445
3445
#: src/types/cast.md:57
3446
3446
msgid "\" 128 as a i8 is : {}\""
3447
- msgstr "\" 128 作为 i8 是:{}\""
3447
+ msgstr "\" 128 转换为 i8 是:{}\""
3448
3448
3449
3449
#: src/types/cast.md:59
3450
3450
msgid ""
3451
3451
"// repeating the example above\n"
3452
3452
" // 1000 as u8 -> 232\n"
3453
3453
msgstr ""
3454
3454
"// 重复上面的例子\n"
3455
- " // 1000 作为 u8 -> 232\n"
3455
+ " // 1000 转换为 u8 -> 232\n"
3456
3456
3457
3457
#: src/types/cast.md:62
3458
3458
msgid ""
3459
3459
"// and the value of 232 in 8-bit two's complement representation is -24\n"
3460
- msgstr "// 而 232 在 8 位二进制补码表示中是 -24\n"
3460
+ msgstr "// 而 232 在 8 位二进制补码表示中为 -24\n"
3461
3461
3462
3462
#: src/types/cast.md:63
3463
3463
msgid "\" 232 as a i8 is : {}\""
3464
- msgstr "\" 232 作为 i8 是:{}\""
3464
+ msgstr "\" 232 转换为 i8 是:{}\""
3465
3465
3466
3466
#: src/types/cast.md:65
3467
3467
msgid ""
@@ -3470,106 +3470,105 @@ msgid ""
3470
3470
" // the upper bound or is less than the lower bound, the returned value\n"
3471
3471
" // will be equal to the bound crossed.\n"
3472
3472
msgstr ""
3473
- "// 从 Rust 1.45 开始,`as` 关键字在从浮点数转换为整数时执行 *饱和转换*\n"
3474
- " // 如果浮点值超过上界或小于下界 ,返回值\n"
3475
- " // 将等于所跨越的边界 。\n"
3473
+ "// 从 Rust 1.45 开始,`as` 关键字在浮点数转整数时执行 *饱和转换*\n"
3474
+ " // 如果浮点值超出上界或低于下界 ,返回值\n"
3475
+ " // 将等于所越过的边界值 。\n"
3476
3476
3477
3477
#: src/types/cast.md:70
3478
3478
msgid "// 300.0 as u8 is 255\n"
3479
- msgstr "// 300.0 作为 u8 是 255\n"
3479
+ msgstr "// 300.0 转换为 u8 是 255\n"
3480
3480
3481
3481
#: src/types/cast.md:71 src/types/cast.md:82
3482
3482
msgid "\" 300.0 as u8 is : {}\""
3483
- msgstr "\" 300.0 作为 u8 是:{}\""
3483
+ msgstr "\" 300.0 转换为 u8 是:{}\""
3484
3484
3485
3485
#: src/types/cast.md:72
3486
3486
msgid "// -100.0 as u8 is 0\n"
3487
- msgstr "// -100.0 作为 u8 是 0\n"
3487
+ msgstr "// -100.0 转换为 u8 是 0\n"
3488
3488
3489
3489
#: src/types/cast.md:73 src/types/cast.md:84
3490
3490
msgid "\"-100.0 as u8 is : {}\""
3491
- msgstr "\"-100.0 作为 u8 是:{}\""
3491
+ msgstr "\"-100.0 转换为 u8 是:{}\""
3492
3492
3493
3493
#: src/types/cast.md:74 src/types/cast.md:85
3494
3494
msgid "// nan as u8 is 0\n"
3495
- msgstr "// nan 作为 u8 是 0\n"
3495
+ msgstr "// NaN 转换为 u8 是 0\n"
3496
3496
3497
3497
#: src/types/cast.md:75 src/types/cast.md:86
3498
3498
msgid "\" nan as u8 is : {}\""
3499
- msgstr "\" nan 作为 u8 是:{}\""
3499
+ msgstr "\" NaN 转换为 u8 是:{}\""
3500
3500
3501
3501
#: src/types/cast.md:77
3502
3502
msgid ""
3503
3503
"// This behavior incurs a small runtime cost and can be avoided\n"
3504
3504
" // with unsafe methods, however the results might overflow and\n"
3505
3505
" // return **unsound values**. Use these methods wisely:\n"
3506
3506
msgstr ""
3507
- "// 这种行为会产生小的运行时开销,可以通过\n"
3508
- " // 不安全的方法来避免,但是结果可能会溢出并\n"
3509
- " // 返回**不健全的值**。请谨慎使用这些方法:\n"
3507
+ "// 这种行为会产生少量运行时开销,可以通过不安全方法避免,\n"
3508
+ " // 但结果可能溢出并返回**不可靠的值**。请谨慎使用这些方法:\n"
3510
3509
3511
3510
#: src/types/cast.md:81
3512
3511
msgid "// 300.0 as u8 is 44\n"
3513
- msgstr "// 300.0 作为 u8 是 44\n"
3512
+ msgstr "// 300.0 转换为 u8 是 44\n"
3514
3513
3515
3514
#: src/types/cast.md:83
3516
3515
msgid "// -100.0 as u8 is 156\n"
3517
- msgstr "// -100.0 作为 u8 是 156\n"
3516
+ msgstr "// -100.0 转换为 u8 是 156\n"
3518
3517
3519
3518
#: src/types/literals.md:3
3520
3519
msgid ""
3521
3520
"Numeric literals can be type annotated by adding the type as a suffix. As an "
3522
3521
"example, to specify that the literal `42` should have the type `i32`, write "
3523
3522
"`42i32`."
3524
3523
msgstr ""
3525
- "数字字面值可以通过添加类型作为后缀来进行类型标注 。例如,要指定字面值 `42` 应该具有 `i32` 类型 ,可以写成 `42i32`。"
3524
+ "数字字面值可以通过添加类型后缀进行类型标注 。例如,要指定字面值 `42` 的类型为 `i32`,可以写成 `42i32`。"
3526
3525
3527
3526
#: src/types/literals.md:6
3528
3527
msgid ""
3529
3528
"The type of unsuffixed numeric literals will depend on how they are used. If "
3530
3529
"no constraint exists, the compiler will use `i32` for integers, and `f64` for "
3531
3530
"floating-point numbers."
3532
3531
msgstr ""
3533
- "无后缀数字字面值的类型将取决于它们的使用方式 。如果没有约束,编译器将对整数使用 `i32`,对浮点数使用 `f64`。"
3532
+ "无后缀数字字面值的类型取决于其使用方式 。如果没有约束,编译器将对整数使用 `i32`,对浮点数使用 `f64`。"
3534
3533
3535
3534
#: src/types/literals.md:12
3536
3535
msgid "// Suffixed literals, their types are known at initialization\n"
3537
- msgstr "// 带后缀的字面值,它们的类型在初始化时就已知 \n"
3536
+ msgstr "// 带后缀的字面值,其类型在初始化时确定 \n"
3538
3537
3539
3538
#: src/types/literals.md:17
3540
3539
msgid "// Unsuffixed literals, their types depend on how they are used\n"
3541
- msgstr "// 无后缀的字面值,它们的类型取决于使用方式 \n"
3540
+ msgstr "// 无后缀的字面值,其类型取决于使用方式 \n"
3542
3541
3543
3542
#: src/types/literals.md:21
3544
3543
msgid "// `size_of_val` returns the size of a variable in bytes\n"
3545
- msgstr "// `size_of_val` 返回变量的大小(以字节为单位) \n"
3544
+ msgstr "// `size_of_val` 返回变量的字节大小 \n"
3546
3545
3547
3546
#: src/types/literals.md:22
3548
3547
msgid "\"size of `x` in bytes: {}\""
3549
- msgstr "\"x 的大小(字节) :{}\""
3548
+ msgstr "\"`x` 的字节大小 :{}\""
3550
3549
3551
3550
#: src/types/literals.md:23
3552
3551
msgid "\"size of `y` in bytes: {}\""
3553
- msgstr "\"y 的大小(字节) :{}\""
3552
+ msgstr "\"`y` 的字节大小 :{}\""
3554
3553
3555
3554
#: src/types/literals.md:24
3556
3555
msgid "\"size of `z` in bytes: {}\""
3557
- msgstr "\"z 的大小(字节) :{}\""
3556
+ msgstr "\"`z` 的字节大小 :{}\""
3558
3557
3559
3558
#: src/types/literals.md:25
3560
3559
msgid "\"size of `i` in bytes: {}\""
3561
- msgstr "\"i 的大小(字节) :{}\""
3560
+ msgstr "\"`i` 的字节大小 :{}\""
3562
3561
3563
3562
#: src/types/literals.md:26
3564
3563
msgid "\"size of `f` in bytes: {}\""
3565
- msgstr "\"f 的大小(字节) :{}\""
3564
+ msgstr "\"`f` 的字节大小 :{}\""
3566
3565
3567
3566
#: src/types/literals.md:30
3568
3567
msgid ""
3569
3568
"There are some concepts used in the previous code that haven't been explained "
3570
3569
"yet, here's a brief explanation for the impatient readers:"
3571
3570
msgstr ""
3572
- "上面的代码中使用了一些尚未解释的概念,这里为急于了解的读者提供一个简短的解释 :"
3571
+ "前面的代码中使用了一些尚未解释的概念。为了满足迫不及待的读者,这里简要说明如下 :"
3573
3572
3574
3573
#: src/types/literals.md:33
3575
3574
msgid ""
@@ -3579,7 +3578,7 @@ msgid ""
3579
3578
"is defined in the `std` _crate_. For more details, see [modules](../mod.md) "
3580
3579
"and [crates](../crates.md)."
3581
3580
msgstr ""
3582
- "`std::mem::size_of_val` 是一个函数,但使用其** 完整路径**调用。代码可以分割成称为**模块** 的逻辑单元。在这种情况下 ,`size_of_val` 函数定义在 `mem` 模块中,而 `mem` 模块定义在 `std` * crate* 中。更多详情,请参见 [模块](../mod.md)和[crate](../crates.md)。"
3581
+ "`std::mem::size_of_val` 是一个函数,这里使用了它的" 完整路径"来调用。代码可以被划分为称为"模块" 的逻辑单元。在这个例子中 ,`size_of_val` 函数定义在 `mem` 模块中,而 `mem` 模块则定义在 `std` crate 中。更多详情请参阅 [模块](../mod.md)和[crate](../crates.md)。"
3583
3582
3584
3583
#: src/types/inference.md:3
3585
3584
msgid ""
@@ -3588,43 +3587,44 @@ msgid ""
3588
3587
"the variable is used afterwards to infer its type. Here's an advanced example "
3589
3588
"of type inference:"
3590
3589
msgstr ""
3591
- "类型推断引擎非常智能。它不仅在初始化期间查看值表达式的类型,还会查看变量后续如何使用来推断其类型。以下是一个高级的类型推断示例 :"
3590
+ "类型推断引擎相当智能。它不仅在初始化时分析值表达式的类型,还会根据变量后续的使用方式来推断其类型。下面是一个类型推断的高级示例 :"
3592
3591
3593
3592
#: src/types/inference.md:10
3594
3593
msgid ""
3595
3594
"// Because of the annotation, the compiler knows that `elem` has type u8.\n"
3596
3595
msgstr ""
3597
- "// 由于注解,编译器知道 `elem` 的类型是 u8。 \n"
3596
+ "// 通过类型注解,编译器得知 `elem` 的类型为 u8 \n"
3598
3597
3599
3598
#: src/types/inference.md:13
3600
3599
msgid "// Create an empty vector (a growable array).\n"
3601
- msgstr "// 创建一个空向量(可增长的数组)。 \n"
3600
+ msgstr "// 创建一个空向量(可增长的数组)\n"
3602
3601
3603
3602
#: src/types/inference.md:15
3604
3603
msgid ""
3605
3604
"// At this point the compiler doesn't know the exact type of `vec`, it\n"
3606
3605
" // just knows that it's a vector of something (`Vec<_>`).\n"
3607
3606
msgstr ""
3608
- "// 在这一点上,编译器不知道 `vec` 的确切类型 ,\n"
3609
- " // 它只知道这是一个某种类型的向量 (`Vec<_>`)。\n"
3607
+ "// 此时编译器还不知道 `vec` 的具体类型 ,\n"
3608
+ " // 只知道它是某种类型的向量 (`Vec<_>`)。\n"
3610
3609
3611
3610
#: src/types/inference.md:18
3612
3611
msgid "// Insert `elem` in the vector.\n"
3613
- msgstr "// 将 `elem` 插入向量。 \n"
3612
+ msgstr "// 将 `elem` 插入向量中 \n"
3614
3613
3615
3614
#: src/types/inference.md:20
3616
3615
msgid ""
3617
3616
"// Aha! Now the compiler knows that `vec` is a vector of `u8`s (`Vec<u8>`)\n"
3618
3617
" // TODO ^ Try commenting out the `vec.push(elem)` line\n"
3619
3618
msgstr ""
3620
- "// 啊哈!现在编译器知道 `vec` 是一个 `u8` 类型的向量(`Vec<u8>`)\n"
3619
+ "// 啊哈!现在编译器知道 `vec` 是 `u8` 类型的向量(`Vec<u8>`)\n"
3621
3620
" // TODO ^ 尝试注释掉 `vec.push(elem)` 这一行\n"
3622
3621
3623
3622
#: src/types/inference.md:27
3624
3623
msgid ""
3625
3624
"No type annotation of variables was needed, the compiler is happy and so is "
3626
3625
"the programmer!"
3627
- msgstr "不需要变量的类型标注,编译器很开心,程序员也很开心!"
3626
+ msgstr ""
3627
+ "无需为变量添加类型注解,编译器和程序员都很满意!"
3628
3628
3629
3629
#: src/types/alias.md:3
3630
3630
msgid ""
0 commit comments