(pattern: &PyPattern, repl: PyStrRef, search_text: PyStrRef, limit: usize)
| 159 | } |
| 160 | |
| 161 | fn do_sub(pattern: &PyPattern, repl: PyStrRef, search_text: PyStrRef, limit: usize) -> String { |
| 162 | let out = pattern |
| 163 | .regex |
| 164 | .replacen(search_text.as_bytes(), limit, repl.as_bytes()); |
| 165 | String::from_utf8_lossy(&out).into_owned() |
| 166 | } |
| 167 | |
| 168 | fn do_match(pattern: &PyPattern, search_text: PyStrRef) -> Option<PyMatch> { |
| 169 | // I really wish there was a better way to do this; I don't think there is |
no test coverage detected