add BitVec::len
This commit is contained in:
		
							parent
							
								
									571cf73510
								
							
						
					
					
						commit
						8ceaef72fa
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -39,6 +39,10 @@ impl BitVec {
 | 
				
			||||||
        self.data.fill(byte);
 | 
					        self.data.fill(byte);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    pub fn len(&self) -> usize {
 | 
				
			||||||
 | 
					        self.data.len()
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fn get_indexes(&self, index: usize) -> (usize, u8) {
 | 
					    fn get_indexes(&self, index: usize) -> (usize, u8) {
 | 
				
			||||||
        let byte_index = index / 8;
 | 
					        let byte_index = index / 8;
 | 
				
			||||||
        let bit_in_byte_index = 7 - index % 8;
 | 
					        let bit_in_byte_index = 7 - index % 8;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue