| 197 | } |
| 198 | |
| 199 | fn diff_changes_deleted_content_contains(values: &[Box<dyn Value>]) -> Box<dyn Value> { |
| 200 | if let Some(changes) = values[0].as_any().downcast_ref::<DiffChangesValue>() { |
| 201 | let str = values[1].as_text().unwrap(); |
| 202 | let mut content = String::new(); |
| 203 | for change in changes.changes.iter() { |
| 204 | if change.kind == DiffChangeKind::Deletion { |
| 205 | content += &String::from_utf8_lossy(&change.content); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | return Box::new(BoolValue::new(content.contains(&str))); |
| 210 | } |
| 211 | Box::new(BoolValue::new_false()) |
| 212 | } |
| 213 | |
| 214 | fn diff_changes_modified_content_contains(values: &[Box<dyn Value>]) -> Box<dyn Value> { |
| 215 | if let Some(changes) = values[0].as_any().downcast_ref::<DiffChangesValue>() { |