@@ -941,7 +941,7 @@ pub trait ImmutableVector<'a, T> {
941
941
942
942
/// Returns the element of a vector at the given index, or `None` if the
943
943
/// index is out of bounds
944
- fn get_opt ( & self , index : uint ) -> Option < & ' a T > ;
944
+ fn get ( & self , index : uint ) -> Option < & ' a T > ;
945
945
/// Returns the first element of a vector, failing if the vector is empty.
946
946
fn head ( & self ) -> & ' a T ;
947
947
/// Returns the first element of a vector, or `None` if it is empty
@@ -1118,7 +1118,7 @@ impl<'a,T> ImmutableVector<'a, T> for &'a [T] {
1118
1118
}
1119
1119
1120
1120
#[ inline]
1121
- fn get_opt ( & self , index : uint ) -> Option < & ' a T > {
1121
+ fn get ( & self , index : uint ) -> Option < & ' a T > {
1122
1122
if index < self . len ( ) { Some ( & self [ index] ) } else { None }
1123
1123
}
1124
1124
@@ -3043,13 +3043,13 @@ mod tests {
3043
3043
}
3044
3044
3045
3045
#[ test]
3046
- fn test_get_opt ( ) {
3046
+ fn test_get ( ) {
3047
3047
let mut a = ~[ 11 ] ;
3048
- assert_eq ! ( a. get_opt ( 1 ) , None ) ;
3048
+ assert_eq ! ( a. get ( 1 ) , None ) ;
3049
3049
a = ~[ 11 , 12 ] ;
3050
- assert_eq ! ( a. get_opt ( 1 ) . unwrap( ) , & 12 ) ;
3050
+ assert_eq ! ( a. get ( 1 ) . unwrap( ) , & 12 ) ;
3051
3051
a = ~[ 11 , 12 , 13 ] ;
3052
- assert_eq ! ( a. get_opt ( 1 ) . unwrap( ) , & 12 ) ;
3052
+ assert_eq ! ( a. get ( 1 ) . unwrap( ) , & 12 ) ;
3053
3053
}
3054
3054
3055
3055
#[ test]
0 commit comments