Skip to content

Commit 651e63c

Browse files
committed
libcore: rename *flate_buf to *flate_bytes (#3444)
1 parent f1f5739 commit 651e63c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/libcore/flate.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const lz_fast : c_int = 0x1; // LZ with only one probe
1818
const lz_norm : c_int = 0x80; // LZ with 128 probes, "normal"
1919
const lz_best : c_int = 0xfff; // LZ with 4095 probes, "best"
2020

21-
fn deflate_buf(buf: &[const u8]) -> ~[u8] {
22-
do vec::as_const_buf(buf) |b, len| {
21+
fn deflate_bytes(bytes: &[const u8]) -> ~[u8] {
22+
do vec::as_const_buf(bytes) |b, len| {
2323
unsafe {
2424
let mut outsz : size_t = 0;
2525
let res =
@@ -36,8 +36,8 @@ fn deflate_buf(buf: &[const u8]) -> ~[u8] {
3636
}
3737
}
3838

39-
fn inflate_buf(buf: &[const u8]) -> ~[u8] {
40-
do vec::as_const_buf(buf) |b, len| {
39+
fn inflate_bytes(bytes: &[const u8]) -> ~[u8] {
40+
do vec::as_const_buf(bytes) |b, len| {
4141
unsafe {
4242
let mut outsz : size_t = 0;
4343
let res =
@@ -69,11 +69,11 @@ fn test_flate_round_trip() {
6969
}
7070
debug!("de/inflate of %u bytes of random word-sequences",
7171
in.len());
72-
let cmp = flate::deflate_buf(in);
73-
let out = flate::inflate_buf(cmp);
72+
let cmp = flate::deflate_bytes(in);
73+
let out = flate::inflate_bytes(cmp);
7474
debug!("%u bytes deflated to %u (%.1f%% size)",
7575
in.len(), cmp.len(),
7676
100.0 * ((cmp.len() as float) / (in.len() as float)));
7777
assert(in == out);
7878
}
79-
}
79+
}

src/rustc/metadata/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ fn encode_metadata(parms: encode_parms, crate: @crate) -> ~[u8] {
11781178

11791179
(do str::as_bytes(~"rust\x00\x00\x00\x01") |bytes| {
11801180
vec::slice(bytes, 0, 8)
1181-
}) + flate::deflate_buf(io::mem_buffer_buf(buf))
1181+
}) + flate::deflate_bytes(io::mem_buffer_buf(buf))
11821182
}
11831183

11841184
// Get the encoded string for a type

src/rustc/metadata/loader.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ fn get_metadata_section(os: os,
202202
let cvbuf1 = ptr::offset(cvbuf, vlen);
203203
debug!("inflating %u bytes of compressed metadata",
204204
csz - vlen);
205-
do vec::raw::form_slice(cvbuf1, csz-vlen) |buf| {
206-
let inflated = flate::inflate_buf(buf);
205+
do vec::raw::form_slice(cvbuf1, csz-vlen) |bytes| {
206+
let inflated = flate::inflate_bytes(bytes);
207207
found = move Some(@(move inflated));
208208
}
209209
if found != None {

0 commit comments

Comments
 (0)