Normalize a URLConf pattern to a leading-slash path, stripping regex anchors.
(raw: &str)
| 247 | |
| 248 | /// Normalize a URLConf pattern to a leading-slash path, stripping regex anchors. |
| 249 | fn normalize_route(raw: &str) -> String { |
| 250 | let trimmed = raw.trim_start_matches('^').trim_end_matches('$'); |
| 251 | |
| 252 | if trimmed.starts_with('/') { |
| 253 | trimmed.to_string() |
| 254 | } else { |
| 255 | format!("/{trimmed}") |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | fn routes_from_decorator(expression: &Expression, routes: &mut Vec<Route>) { |
| 260 | let Expression::Call(CallExpression { |
no outgoing calls
no test coverage detected