(&self)
| 63 | /// (443 for `https`, 80 for `http`). |
| 64 | #[must_use] |
| 65 | pub fn to_display_string(&self) -> String { |
| 66 | let scheme = self.scheme.as_deref().unwrap_or("https"); |
| 67 | let hostname = self.hostname.as_deref().unwrap_or("unknown"); |
| 68 | let path = self.path.as_deref().unwrap_or("/"); |
| 69 | let port_suffix = match self.port { |
| 70 | Some(443) if scheme == "https" => String::new(), |
| 71 | Some(80) if scheme == "http" => String::new(), |
| 72 | Some(p) => format!(":{p}"), |
| 73 | None => String::new(), |
| 74 | }; |
| 75 | format!("{scheme}://{hostname}{port_suffix}{path}") |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | impl HttpRequest { |
nothing calls this directly
no outgoing calls
no test coverage detected