(
entry: &CanonicalTrackedPath,
change: VerifiedChange,
content_id: Option<Hash>,
)
| 925 | } |
| 926 | |
| 927 | fn root_row( |
| 928 | entry: &CanonicalTrackedPath, |
| 929 | change: VerifiedChange, |
| 930 | content_id: Option<Hash>, |
| 931 | ) -> Vec<u8> { |
| 932 | let mut bytes = Vec::new(); |
| 933 | bytes.extend_from_slice(&(entry.path.as_bytes().len() as u64).to_le_bytes()); |
| 934 | bytes.extend_from_slice(entry.path.as_bytes()); |
| 935 | bytes.push(match change { |
| 936 | VerifiedChange::Unchanged => 0, |
| 937 | VerifiedChange::Modified => 1, |
| 938 | VerifiedChange::Deleted => 2, |
| 939 | VerifiedChange::TypeChanged => 3, |
| 940 | VerifiedChange::PermissionsChanged => 4, |
| 941 | }); |
| 942 | bytes.extend_from_slice(&entry.canonical_mode.to_le_bytes()); |
| 943 | bytes.push(entry.canonical_kind.as_byte()); |
| 944 | if let Some(content_id) = content_id { |
| 945 | bytes.extend_from_slice(content_id.as_bytes()); |
| 946 | } else { |
| 947 | bytes.extend_from_slice(&[0; 32]); |
| 948 | } |
| 949 | bytes |
| 950 | } |
| 951 | |
| 952 | fn canonical_root_bytes(rows: &[Vec<u8>]) -> Vec<u8> { |
| 953 | let mut bytes = b"atomic.verified-candidates-v1\0".to_vec(); |
no test coverage detected