| 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>() { |
| 216 | let str = values[1].as_text().unwrap(); |
| 217 | let mut content = String::new(); |
| 218 | for change in changes.changes.iter() { |
| 219 | if change.kind == DiffChangeKind::Modification { |
| 220 | content += &String::from_utf8_lossy(&change.content); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | return Box::new(BoolValue::new(content.contains(&str))); |
| 225 | } |
| 226 | Box::new(BoolValue::new_false()) |
| 227 | } |
| 228 | |
| 229 | fn diff_changed_files(values: &[Box<dyn Value>]) -> Box<dyn Value> { |
| 230 | if let Some(changes) = values[0].as_any().downcast_ref::<DiffChangesValue>() { |