(
left: Option<ObjectBorrow>,
right: Option<ObjectBorrow>,
diff_config: DiffConfigBorrow,
mapping_config: MappingConfig,
)
| 58 | type ObjectDiff = ResourceObjectDiff; |
| 59 | |
| 60 | fn run_diff( |
| 61 | left: Option<ObjectBorrow>, |
| 62 | right: Option<ObjectBorrow>, |
| 63 | diff_config: DiffConfigBorrow, |
| 64 | mapping_config: MappingConfig, |
| 65 | ) -> Result<DiffResult, String> { |
| 66 | let diff_config = diff_config.get::<ResourceDiffConfig>().0.borrow(); |
| 67 | let mapping_config = diff::MappingConfig::from(mapping_config); |
| 68 | log::debug!("Running diff with config: {:?}", diff_config); |
| 69 | let result = diff::diff_objs( |
| 70 | left.as_ref().map(|o| o.get::<ResourceObject>().0.as_ref()), |
| 71 | right.as_ref().map(|o| o.get::<ResourceObject>().0.as_ref()), |
| 72 | None, |
| 73 | &diff_config, |
| 74 | &mapping_config, |
| 75 | ) |
| 76 | .map_err(|e| e.to_string())?; |
| 77 | Ok(DiffResult { |
| 78 | left: result.left.map(|d| { |
| 79 | ObjectDiff::new(ResourceObjectDiff( |
| 80 | left.unwrap().get::<ResourceObject>().0.clone(), |
| 81 | d, |
| 82 | )) |
| 83 | }), |
| 84 | right: result.right.map(|d| { |
| 85 | ObjectDiff::new(ResourceObjectDiff( |
| 86 | right.unwrap().get::<ResourceObject>().0.clone(), |
| 87 | d, |
| 88 | )) |
| 89 | }), |
| 90 | }) |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | fn build_regex(s: &str) -> Option<Regex> { |
nothing calls this directly
no test coverage detected