File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,19 @@ struct StringBuilder {
19
19
}
20
20
21
21
///|
22
+ /// Creates a new string builder with an optional initial capacity hint.
23
+ ///
24
+ /// Parameters:
25
+ ///
26
+ /// * `size_hint` : An optional initial capacity hint for the internal buffer. If
27
+ /// less than 1, a minimum capacity of 1 is used. Defaults to 0. It is the size of bytes,
28
+ /// not the size of characters. `size_hint` may be ignored on some platforms, JS for example.
29
+ ///
30
+ /// Returns a new `StringBuilder` instance with the specified initial capacity.
31
+ ///
22
32
pub fn StringBuilder ::new (size_hint ~ : Int = 0 ) -> StringBuilder {
23
33
let initial = if size_hint < 1 { 1 } else { size_hint }
24
- let data = FixedArray ::make (initial , Byte :: default () )
34
+ let data : FixedArray [ Byte ] = FixedArray ::make (initial , 0 )
25
35
{ data , len : 0 }
26
36
}
27
37
You can’t perform that action at this time.
0 commit comments