diff options
| author | bors <bors@rust-lang.org> | 2013-07-12 13:34:29 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-07-12 13:34:29 -0700 |
| commit | 96453eb5c524fea0ee48b9a8e4b60c12dd0e9fc9 (patch) | |
| tree | d50a3ccbaca480e6ef0f526fc0591622c20c542d /src/libextra | |
| parent | 5cc4e5145dc971c032eb106b7a6866b8aa274482 (diff) | |
| parent | 9b21bf45e9be7410f2370e5f178c46f3415b6765 (diff) | |
| download | rust-96453eb5c524fea0ee48b9a8e4b60c12dd0e9fc9.tar.gz rust-96453eb5c524fea0ee48b9a8e4b60c12dd0e9fc9.zip | |
auto merge of #7736 : thestinger/rust/doc, r=thestinger
2b96408 r=sanxiyn documents conversion, size hints and double-ended iterators and adds more of the traits to the prelude
Diffstat (limited to 'src/libextra')
| -rw-r--r-- | src/libextra/bitv.rs | 8 | ||||
| -rw-r--r-- | src/libextra/flatpipes.rs | 2 | ||||
| -rw-r--r-- | src/libextra/getopts.rs | 2 | ||||
| -rw-r--r-- | src/libextra/md4.rs | 2 | ||||
| -rw-r--r-- | src/libextra/num/bigint.rs | 2 | ||||
| -rw-r--r-- | src/libextra/stats.rs | 7 |
6 files changed, 11 insertions, 12 deletions
diff --git a/src/libextra/bitv.rs b/src/libextra/bitv.rs index 9f71dc8a1af..7a0db7a1de7 100644 --- a/src/libextra/bitv.rs +++ b/src/libextra/bitv.rs @@ -104,7 +104,7 @@ impl SmallBitv { } #[inline] - pub fn invert(&mut self) { self.bits = !self.bits; } + pub fn negate(&mut self) { self.bits = !self.bits; } } struct BigBitv { @@ -160,7 +160,7 @@ impl BigBitv { } #[inline] - pub fn invert(&mut self) { for self.each_storage |w| { *w = !*w } } + pub fn negate(&mut self) { for self.each_storage |w| { *w = !*w } } #[inline] pub fn union(&mut self, b: &BigBitv, nbits: uint) -> bool { @@ -366,9 +366,9 @@ impl Bitv { /// Invert all bits #[inline] - pub fn invert(&mut self) { + pub fn negate(&mut self) { match self.rep { - Small(ref mut b) => b.invert(), + Small(ref mut b) => b.negate(), Big(ref mut s) => for s.each_storage() |w| { *w = !*w } } } diff --git a/src/libextra/flatpipes.rs b/src/libextra/flatpipes.rs index de0a988f94c..9ce7362ef71 100644 --- a/src/libextra/flatpipes.rs +++ b/src/libextra/flatpipes.rs @@ -446,7 +446,7 @@ pub mod flatteners { T: Decodable<D>>( buf: &[u8]) -> T { - let buf = vec::to_owned(buf); + let buf = buf.to_owned(); let buf_reader = @BufReader::new(buf); let reader = buf_reader as @Reader; let mut deser: D = FromReader::from_reader(reader); diff --git a/src/libextra/getopts.rs b/src/libextra/getopts.rs index c481fb8f544..f8119143c61 100644 --- a/src/libextra/getopts.rs +++ b/src/libextra/getopts.rs @@ -343,7 +343,7 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result { } i += 1; } - return Ok(Matches {opts: vec::to_owned(opts), + return Ok(Matches {opts: opts.to_owned(), vals: vals, free: free}); } diff --git a/src/libextra/md4.rs b/src/libextra/md4.rs index 6b08fea580f..2c60be44519 100644 --- a/src/libextra/md4.rs +++ b/src/libextra/md4.rs @@ -28,7 +28,7 @@ pub fn md4(msg: &[u8]) -> Quad { let orig_len: u64 = (msg.len() * 8u) as u64; // pad message - let mut msg = vec::append(vec::to_owned(msg), [0x80u8]); + let mut msg = vec::append(msg.to_owned(), [0x80u8]); let mut bitlen = orig_len + 8u64; while (bitlen + 64u64) % 512u64 > 0u64 { msg.push(0u8); diff --git a/src/libextra/num/bigint.rs b/src/libextra/num/bigint.rs index 13b55a4609b..4bc77f313df 100644 --- a/src/libextra/num/bigint.rs +++ b/src/libextra/num/bigint.rs @@ -567,7 +567,7 @@ impl BigUint { /// Creates and initializes an BigUint. pub fn from_slice(slice: &[BigDigit]) -> BigUint { - return BigUint::new(vec::to_owned(slice)); + return BigUint::new(slice.to_owned()); } /// Creates and initializes an BigUint. diff --git a/src/libextra/stats.rs b/src/libextra/stats.rs index b6a2deb1663..f488c03ce75 100644 --- a/src/libextra/stats.rs +++ b/src/libextra/stats.rs @@ -12,7 +12,6 @@ use sort; use std::cmp; use std::io; use std::num; -use std::vec; // NB: this can probably be rewritten in terms of num::Num // to be less f64-specific. @@ -200,13 +199,13 @@ impl<'self> Stats for &'self [f64] { } fn percentile(self, pct: f64) -> f64 { - let mut tmp = vec::to_owned(self); + let mut tmp = self.to_owned(); sort::tim_sort(tmp); percentile_of_sorted(tmp, pct) } fn quartiles(self) -> (f64,f64,f64) { - let mut tmp = vec::to_owned(self); + let mut tmp = self.to_owned(); sort::tim_sort(tmp); let a = percentile_of_sorted(tmp, 25.0); let b = percentile_of_sorted(tmp, 50.0); @@ -251,7 +250,7 @@ priv fn percentile_of_sorted(sorted_samples: &[f64], /// /// See: http://en.wikipedia.org/wiki/Winsorising pub fn winsorize(samples: &mut [f64], pct: f64) { - let mut tmp = vec::to_owned(samples); + let mut tmp = samples.to_owned(); sort::tim_sort(tmp); let lo = percentile_of_sorted(tmp, pct); let hi = percentile_of_sorted(tmp, 100.0-pct); |
