diff --git a/language/documentation/book/translations/move-book-zh/src/generics.md b/language/documentation/book/translations/move-book-zh/src/generics.md index c5553d2693..888ca5df47 100644 --- a/language/documentation/book/translations/move-book-zh/src/generics.md +++ b/language/documentation/book/translations/move-book-zh/src/generics.md @@ -269,7 +269,7 @@ struct Bar { x: Foo } // ^ 错误!u8 没有 'key' struct Baz { x: Foo } -// ^ 错误! t 没有 'key' +// ^ 错误! T 没有 'key' ``` ```move @@ -287,7 +287,7 @@ fun consume(x: T) { fun foo() { let r = R {}; consume(r); - // ^ 错误!r 没有 'drop' + // ^ 错误!R 没有 'drop' } ``` @@ -306,7 +306,7 @@ fun double(x: T) { fun foo(): (R, R) { let r = R {}; double(r) - // ^ 错误!R 没有 'error' + // ^ 错误!R 没有 'copy' } ``` diff --git a/language/move-binary-format/src/file_format.rs b/language/move-binary-format/src/file_format.rs index 680d94a2fb..8eabac204f 100644 --- a/language/move-binary-format/src/file_format.rs +++ b/language/move-binary-format/src/file_format.rs @@ -1207,7 +1207,7 @@ pub enum Bytecode { /// /// Stack transition: /// - /// ```..., integer_value -> ..., u8_value``` + /// ```..., integer_value -> ..., u64_value``` CastU64, /// Convert the value at the top of the stack into u128. /// diff --git a/language/move-stdlib/docs/string.md b/language/move-stdlib/docs/string.md index e962b56d86..eae6e89293 100644 --- a/language/move-stdlib/docs/string.md +++ b/language/move-stdlib/docs/string.md @@ -101,7 +101,7 @@ Creates a new string from a sequence of bytes. Aborts if the bytes do not repres
public fun utf8(bytes: vector<u8>): String {
     assert!(internal_check_utf8(&bytes), EINVALID_UTF8);
-    String{bytes}
+    String { bytes }
 }
 
@@ -127,7 +127,7 @@ Tries to create a new string from a sequence of bytes.
public fun try_utf8(bytes: vector<u8>): Option<String> {
     if (internal_check_utf8(&bytes)) {
-        option::some(String{bytes})
+        option::some(String { bytes })
     } else {
         option::none()
     }
@@ -321,7 +321,7 @@ guaranteeing that the result is valid utf8.
         j <= l && i <= j && internal_is_char_boundary(bytes, i) && internal_is_char_boundary(bytes, j),
         EINVALID_INDEX
     );
-    String{bytes: internal_sub_string(bytes, i, j)}
+    String { bytes: internal_sub_string(bytes, i, j) }
 }
 
diff --git a/language/move-stdlib/sources/string.move b/language/move-stdlib/sources/string.move index bf9a74faba..14c3c5144e 100644 --- a/language/move-stdlib/sources/string.move +++ b/language/move-stdlib/sources/string.move @@ -17,13 +17,13 @@ module std::string { /// Creates a new string from a sequence of bytes. Aborts if the bytes do not represent valid utf8. public fun utf8(bytes: vector): String { assert!(internal_check_utf8(&bytes), EINVALID_UTF8); - String{bytes} + String { bytes } } /// Tries to create a new string from a sequence of bytes. public fun try_utf8(bytes: vector): Option { if (internal_check_utf8(&bytes)) { - option::some(String{bytes}) + option::some(String { bytes }) } else { option::none() } @@ -77,7 +77,7 @@ module std::string { j <= l && i <= j && internal_is_char_boundary(bytes, i) && internal_is_char_boundary(bytes, j), EINVALID_INDEX ); - String{bytes: internal_sub_string(bytes, i, j)} + String { bytes: internal_sub_string(bytes, i, j) } } /// Computes the index of the first occurrence of a string. Returns `length(s)` if no occurrence found.