@@ -85,8 +85,6 @@ pub enum Focus<'a, A>
8585where
8686 A : ' a ,
8787{
88- #[ doc( hidden) ]
89- Empty ,
9088 #[ doc( hidden) ]
9189 Single ( & ' a [ A ] ) ,
9290 #[ doc( hidden) ]
@@ -102,7 +100,7 @@ where
102100 /// [Vector]: enum.Vector.html
103101 pub fn new ( vector : & ' a Vector < A > ) -> Self {
104102 match vector {
105- Vector :: Empty => Focus :: Empty ,
103+ Vector :: Inline ( chunk ) => Focus :: Single ( chunk ) ,
106104 Vector :: Single ( chunk) => Focus :: Single ( chunk) ,
107105 Vector :: Full ( tree) => Focus :: Full ( TreeFocus :: new ( tree) ) ,
108106 }
@@ -113,7 +111,6 @@ where
113111 /// [Vector]: enum.Vector.html
114112 pub fn len ( & self ) -> usize {
115113 match self {
116- Focus :: Empty => 0 ,
117114 Focus :: Single ( chunk) => chunk. len ( ) ,
118115 Focus :: Full ( tree) => tree. len ( ) ,
119116 }
@@ -129,7 +126,6 @@ where
129126 /// Get a reference to the value at a given index.
130127 pub fn get ( & mut self , index : usize ) -> Option < & A > {
131128 match self {
132- Focus :: Empty => None ,
133129 Focus :: Single ( chunk) => chunk. get ( index) ,
134130 Focus :: Full ( tree) => tree. get ( index) ,
135131 }
@@ -152,7 +148,6 @@ where
152148 panic ! ( "vector::Focus::chunk_at: index out of bounds" ) ;
153149 }
154150 match self {
155- Focus :: Empty => ( 0 ..0 , & [ ] ) ,
156151 Focus :: Single ( chunk) => ( 0 ..len, chunk) ,
157152 Focus :: Full ( tree) => tree. get_chunk ( index) ,
158153 }
@@ -190,7 +185,6 @@ where
190185 panic ! ( "vector::Focus::narrow: range out of bounds" ) ;
191186 }
192187 match self {
193- Focus :: Empty => Focus :: Empty ,
194188 Focus :: Single ( chunk) => Focus :: Single ( & chunk[ r] ) ,
195189 Focus :: Full ( tree) => Focus :: Full ( tree. narrow ( r) ) ,
196190 }
@@ -231,7 +225,6 @@ where
231225 panic ! ( "vector::Focus::split_at: index out of bounds" ) ;
232226 }
233227 match self {
234- Focus :: Empty => ( Focus :: Empty , Focus :: Empty ) ,
235228 Focus :: Single ( chunk) => {
236229 let ( left, right) = chunk. split_at ( index) ;
237230 ( Focus :: Single ( left) , Focus :: Single ( right) )
@@ -262,7 +255,6 @@ where
262255{
263256 fn clone ( & self ) -> Self {
264257 match self {
265- Focus :: Empty => Focus :: Empty ,
266258 Focus :: Single ( chunk) => Focus :: Single ( chunk) ,
267259 Focus :: Full ( tree) => Focus :: Full ( tree. clone ( ) ) ,
268260 }
@@ -483,8 +475,6 @@ pub enum FocusMut<'a, A>
483475where
484476 A : ' a ,
485477{
486- #[ doc( hidden) ]
487- Empty ,
488478 #[ doc( hidden) ]
489479 Single ( & ' a mut [ A ] ) ,
490480 #[ doc( hidden) ]
@@ -498,7 +488,7 @@ where
498488 /// Construct a `FocusMut` for a `Vector`.
499489 pub fn new ( vector : & ' a mut Vector < A > ) -> Self {
500490 match vector {
501- Vector :: Empty => FocusMut :: Empty ,
491+ Vector :: Inline ( chunk ) => FocusMut :: Single ( chunk ) ,
502492 Vector :: Single ( chunk) => FocusMut :: Single ( Ref :: make_mut ( chunk) . as_mut_slice ( ) ) ,
503493 Vector :: Full ( tree) => FocusMut :: Full ( TreeFocusMut :: new ( tree) ) ,
504494 }
@@ -507,7 +497,6 @@ where
507497 /// Get the length of the focused `Vector`.
508498 pub fn len ( & self ) -> usize {
509499 match self {
510- FocusMut :: Empty => 0 ,
511500 FocusMut :: Single ( chunk) => chunk. len ( ) ,
512501 FocusMut :: Full ( tree) => tree. len ( ) ,
513502 }
@@ -526,7 +515,6 @@ where
526515 /// Get a mutable reference to the value at a given index.
527516 pub fn get_mut ( & mut self , index : usize ) -> Option < & mut A > {
528517 match self {
529- FocusMut :: Empty => None ,
530518 FocusMut :: Single ( chunk) => chunk. get_mut ( index) ,
531519 FocusMut :: Full ( tree) => tree. get ( index) ,
532520 }
@@ -645,7 +633,6 @@ where
645633 panic ! ( "vector::FocusMut::chunk_at: index out of bounds" ) ;
646634 }
647635 match self {
648- FocusMut :: Empty => ( 0 ..0 , & mut [ ] ) ,
649636 FocusMut :: Single ( chunk) => ( 0 ..len, chunk) ,
650637 FocusMut :: Full ( tree) => {
651638 let ( range, chunk) = tree. get_chunk ( index) ;
@@ -686,7 +673,6 @@ where
686673 panic ! ( "vector::FocusMut::narrow: range out of bounds" ) ;
687674 }
688675 match self {
689- FocusMut :: Empty => FocusMut :: Empty ,
690676 FocusMut :: Single ( chunk) => FocusMut :: Single ( & mut chunk[ r] ) ,
691677 FocusMut :: Full ( tree) => FocusMut :: Full ( tree. narrow ( r) ) ,
692678 }
@@ -734,7 +720,6 @@ where
734720 panic ! ( "vector::FocusMut::split_at: index out of bounds" ) ;
735721 }
736722 match self {
737- FocusMut :: Empty => ( FocusMut :: Empty , FocusMut :: Empty ) ,
738723 FocusMut :: Single ( chunk) => {
739724 let ( left, right) = chunk. split_at_mut ( index) ;
740725 ( FocusMut :: Single ( left) , FocusMut :: Single ( right) )
@@ -749,7 +734,6 @@ where
749734 /// Convert a `FocusMut` into a `Focus`.
750735 pub fn unmut ( self ) -> Focus < ' a , A > {
751736 match self {
752- FocusMut :: Empty => Focus :: Empty ,
753737 FocusMut :: Single ( chunk) => Focus :: Single ( chunk) ,
754738 FocusMut :: Full ( mut tree) => Focus :: Full ( TreeFocus {
755739 tree : {
0 commit comments