You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sway-lib-std/src/bytes.sw
+55-54Lines changed: 55 additions & 54 deletions
Original file line number
Diff line number
Diff line change
@@ -816,6 +816,61 @@ impl Bytes {
816
816
817
817
spliced
818
818
}
819
+
820
+
/// Resizes the `Bytes` in-place so that `len` is equal to `new_len`.
821
+
///
822
+
/// # Additional Information
823
+
///
824
+
/// If `new_len` is greater than `len`, the `Bytes` is extended by the difference, with each additional slot filled with `value`. If `new_len` is less than `len`, the `Bytes` is simply truncated.
825
+
///
826
+
/// # Arguments
827
+
///
828
+
/// * `new_len`: [u64] - The new length of the `Bytes`.
829
+
/// * `value`: [u8] - The value to fill the new length.
Copy file name to clipboardExpand all lines: sway-lib-std/src/vec.sw
+65-22Lines changed: 65 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ use ::assert::assert;
6
6
use::option::Option::{self, *};
7
7
use::convert::From;
8
8
use::iterator::*;
9
+
use::clone::Clone;
9
10
10
11
structRawVec<T> {
11
12
ptr:raw_ptr,
@@ -697,6 +698,61 @@ impl<T> Vec<T> {
697
698
pubfnptr(self) ->raw_ptr {
698
699
self.buf.ptr()
699
700
}
701
+
702
+
/// Resizes the `Vec` in-place so that `len` is equal to `new_len`.
703
+
///
704
+
/// # Additional Information
705
+
///
706
+
/// If `new_len` is greater than `len`, the `Vec` is extended by the difference, with each additional slot filled with `value`. If `new_len` is less than `len`, the `Vec` is simply truncated.
707
+
///
708
+
/// # Arguments
709
+
///
710
+
/// * `new_len`: [u64] - The new length of the `Vec`.
711
+
/// * `value`: [T] - The value to fill the new length.
0 commit comments