Function
push_flags
(ty: &TypeFlags, flags: &mut Vec<String>, mut offset: u32, mut bits: u32)
Source from the content-addressed store, hash-verified
| 1142 | } |
| 1143 | |
| 1144 | fn push_flags(ty: &TypeFlags, flags: &mut Vec<String>, mut offset: u32, mut bits: u32) { |
| 1145 | while bits > 0 && usize::try_from(offset).unwrap() < ty.names.len() { |
| 1146 | if bits & 1 != 0 { |
| 1147 | flags.push(ty.names[offset as usize].clone()); |
| 1148 | } |
| 1149 | bits >>= 1; |
| 1150 | offset += 1; |
| 1151 | } |
| 1152 | } |
| 1153 | |
| 1154 | fn flags_to_storage(ty: &TypeFlags, flags: &[String]) -> Result<Vec<u32>> { |
| 1155 | let mut storage = match FlagsSize::from_count(ty.names.len()) { |
Tested by
no test coverage detected