@@ -18,8 +18,8 @@ const lz_fast : c_int = 0x1; // LZ with only one probe
18
18
const lz_norm : c_int = 0x80 ; // LZ with 128 probes, "normal"
19
19
const lz_best : c_int = 0xfff ; // LZ with 4095 probes, "best"
20
20
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| {
23
23
unsafe {
24
24
let mut outsz : size_t = 0 ;
25
25
let res =
@@ -36,8 +36,8 @@ fn deflate_buf(buf: &[const u8]) -> ~[u8] {
36
36
}
37
37
}
38
38
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| {
41
41
unsafe {
42
42
let mut outsz : size_t = 0 ;
43
43
let res =
@@ -69,11 +69,11 @@ fn test_flate_round_trip() {
69
69
}
70
70
debug ! ( "de/inflate of %u bytes of random word-sequences" ,
71
71
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) ;
74
74
debug ! ( "%u bytes deflated to %u (%.1f%% size)" ,
75
75
in. len( ) , cmp. len( ) ,
76
76
100.0 * ( ( cmp. len( ) as float) / ( in. len( ) as float) ) ) ;
77
77
assert( in == out) ;
78
78
}
79
- }
79
+ }
0 commit comments