Showing the changes to git-credentials/src/program (1 of 2 files). Show all
Unified · Split
| @@ -47,7 +47,8 @@ impl Cascade { · 46 unmodified lines | ||
| 47 | 47 | ctx.protocol = Some(url.scheme.as_str().into()); |
| 48 | 48 | ctx.host = url.host().map(ToOwned::to_owned).map(|mut host| { |
| 49 | 49 | if let Some(port) = url.port { |
| 50 | − host.push_str(&format!(":{}", port)); | |
| 50 | + use std::fmt::Write; | |
| 51 | + write!(host, ":{}", port).expect("infallible"); | |
| 51 | 52 | } |
| 52 | 53 | host |
| 53 | 54 | }); |