(input: &'a str, pat: &str)
| 297 | |
| 298 | |
| 299 | fn strip_code_prefix<'a>(input: &'a str, pat: &str) -> &'a str { |
| 300 | let pat = String::from_iter(["```", pat]); |
| 301 | if input.starts_with(&pat) { |
| 302 | if let Some(p) = input.strip_prefix(&pat) { |
| 303 | return p; |
| 304 | } |
| 305 | } |
| 306 | input |
| 307 | } |
| 308 | |
| 309 | /// strip the code wrapper that ChatGPT generated with code. |
| 310 | fn strip_code_wrapper(input: &str) -> String { |
no outgoing calls
no test coverage detected