Finalize hunks by converting them to the serializable format. This validates that all hunks are properly formed and ready for serialization. # Arguments `hunks` - The hunks to finalize `options` - Assembly options for validation # Returns The validated hunks, or an error if validation fails.
(
hunks: Vec<GraphOp<Option<Hash>>>,
options: &AssemblyOptions,
)
| 168 | /// |
| 169 | /// The validated hunks, or an error if validation fails. |
| 170 | pub fn finalize_hunks( |
| 171 | hunks: Vec<GraphOp<Option<Hash>>>, |
| 172 | options: &AssemblyOptions, |
| 173 | ) -> AssemblyResult<Vec<GraphOp<Option<Hash>>>> { |
| 174 | // Check graph_op count limit |
| 175 | if hunks.len() > options.get_max_hunks() { |
| 176 | return Err(AssemblyError::TooManyHunks { |
| 177 | actual: hunks.len(), |
| 178 | limit: options.get_max_hunks(), |
| 179 | }); |
| 180 | } |
| 181 | |
| 182 | Ok(hunks) |
| 183 | } |