Skip to content

Commit 19021eb

Browse files
Yu-zhbobzhang
authored andcommitted
add proper attribute to view types
1 parent fbb143f commit 19021eb

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

builtin/arrayview.mbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
/// assert_eq!(view.length(), 3)
2525
/// ```
2626
#deprecated("use @array.View instead")
27+
#builtin.valtype
2728
struct ArrayView[T] {
2829
buf : UninitializedArray[T]
2930
start : Int

strconv/int.mbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ const INT64_MAX = 0x7fffffffffffffffL
2929
/// and consume the prefix.
3030
/// The boolean flag `allow_underscore` is used to check validity of underscores.
3131
fn check_and_consume_base(
32-
view : @string.StringView,
32+
view : @string.View,
3333
base : Int
34-
) -> (Int, @string.StringView, Bool)!StrConvError {
34+
) -> (Int, @string.View, Bool)!StrConvError {
3535
// if the base is not given, we need to determine it from the prefix
3636
if base == 0 {
3737
match view {

string/view.mbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
/// A `StringView` represents a view of a String that maintains proper Unicode
1717
/// character boundaries. It allows safe access to a substring while handling
1818
/// multi-byte characters correctly.
19-
/// alert deprecated "use @string.View instead"
19+
#deprecated("use @string.View instead")
20+
#builtin.valtype
2021
struct StringView {
2122
// # Fields
2223
//

0 commit comments

Comments
 (0)