File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 8d488f38ed4fad414f9a693b6f4574dfa92b06fd
8
+ refs/heads/try2: 8fce135326707264d99102cdb514b00d6aa38081
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -2244,6 +2244,23 @@ pub mod bytes {
2244
2244
// Bound checks are done at vec::raw::copy_memory.
2245
2245
unsafe { vec:: raw:: copy_memory ( dst, src, count) }
2246
2246
}
2247
+
2248
+ /**
2249
+ * Allocate space in `dst` and append the data in `src`.
2250
+ */
2251
+ #[ inline]
2252
+ pub fn push_bytes ( dst : & mut ~[ u8 ] , src : & [ u8 ] ) {
2253
+ let old_len = dst. len ( ) ;
2254
+ dst. reserve_additional ( src. len ( ) ) ;
2255
+ unsafe {
2256
+ do dst. as_mut_buf |p_dst, len_dst| {
2257
+ do src. as_imm_buf |p_src, len_src| {
2258
+ ptr:: copy_memory ( p_dst. offset ( len_dst as int ) , p_src, len_src)
2259
+ }
2260
+ }
2261
+ vec:: raw:: set_len ( dst, old_len + src. len ( ) ) ;
2262
+ }
2263
+ }
2247
2264
}
2248
2265
2249
2266
impl < A : Clone > Clone for ~[ A ] {
You can’t perform that action at this time.
0 commit comments