(&mut self, op: &CompactGraphOp)
| 105 | Ok(()) |
| 106 | } |
| 107 | fn op(&mut self, op: &CompactGraphOp) -> FormatResult<()> { |
| 108 | op.validate_serialized_name_conflict() |
| 109 | .map_err(|reason| FormatError::InvalidGraphOp { |
| 110 | operation: op.type_name(), |
| 111 | reason, |
| 112 | })?; |
| 113 | use CompactGraphOp::*; |
| 114 | match op { |
| 115 | FileAdd { |
| 116 | add_name, |
| 117 | add_inode, |
| 118 | contents, |
| 119 | path, |
| 120 | encoding, |
| 121 | } => { |
| 122 | put(&mut self.control, 0); |
| 123 | self.insertion(0, add_name)?; |
| 124 | self.insertion(1, add_inode)?; |
| 125 | self.optional_insertion(2, contents)?; |
| 126 | self.path(path)?; |
| 127 | self.aux(encoding)?; |
| 128 | } |
| 129 | DirAdd { |
| 130 | add_name, |
| 131 | add_inode, |
| 132 | path, |
| 133 | } => { |
| 134 | put(&mut self.control, 1); |
| 135 | self.insertion(0, add_name)?; |
| 136 | self.insertion(1, add_inode)?; |
| 137 | self.path(path)?; |
| 138 | } |
| 139 | DirDel { del, path } => { |
| 140 | put(&mut self.control, 2); |
| 141 | self.edges(0, del)?; |
| 142 | self.path(path)?; |
| 143 | } |
| 144 | DirUndel { undel, path } => { |
| 145 | put(&mut self.control, 3); |
| 146 | self.edges(2, undel)?; |
| 147 | self.path(path)?; |
| 148 | } |
| 149 | FileDel { |
| 150 | del, |
| 151 | contents, |
| 152 | path, |
| 153 | encoding, |
| 154 | } => { |
| 155 | put(&mut self.control, 4); |
| 156 | self.edges(0, del)?; |
| 157 | self.optional_edges(1, contents)?; |
| 158 | self.path(path)?; |
| 159 | self.aux(encoding)?; |
| 160 | } |
| 161 | FileUndel { |
| 162 | undel, |
| 163 | contents, |
| 164 | path, |
no test coverage detected