diff options
| author | Oliver 'ker' Schneider <rust19446194516@oli-obk.de> | 2015-06-07 19:50:13 +0200 |
|---|---|---|
| committer | Oliver 'ker' Schneider <rust19446194516@oli-obk.de> | 2015-06-07 19:50:13 +0200 |
| commit | ec078a033bdd2a4d076f78f2e655b8c3e5e4bf6a (patch) | |
| tree | 1ec3554c23443ccc25e44eb90efa4f176fe33df9 /src/libcollections | |
| parent | 2c8d75d655b7d0bf84178f464c47a79569a35f3c (diff) | |
change some statics to constants
Diffstat (limited to 'src/libcollections')
| -rw-r--r-- | src/libcollections/bit.rs | 8 | ||||
| -rw-r--r-- | src/libcollections/vec.rs | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/libcollections/bit.rs b/src/libcollections/bit.rs index c06cbdb4179..afcdb3efe8e 100644 --- a/src/libcollections/bit.rs +++ b/src/libcollections/bit.rs @@ -125,8 +125,8 @@ fn match_words <'a,'b>(a: &'a BitVec, b: &'b BitVec) -> (MatchWords<'a>, MatchWo } } -static TRUE: bool = true; -static FALSE: bool = false; +const TRUE: &'static bool = &true; +const FALSE: &'static bool = &false; /// The bitvector type. /// @@ -172,9 +172,9 @@ impl Index<usize> for BitVec { #[inline] fn index(&self, i: usize) -> &bool { if self.get(i).expect("index out of bounds") { - &TRUE + TRUE } else { - &FALSE + FALSE } } } diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 8dacfa53bc9..d4fecbfec9c 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -83,7 +83,7 @@ use borrow::{Cow, IntoCow}; use super::range::RangeArgument; // FIXME- fix places which assume the max vector allowed has memory usize::MAX. -static MAX_MEMORY_SIZE: usize = isize::MAX as usize; +const MAX_MEMORY_SIZE: usize = isize::MAX as usize; /// A growable list type, written `Vec<T>` but pronounced 'vector.' /// |
