summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2024-09-05 18:01:03 +0200
committerCyborus <cyborus@cyborus.xyz>2024-09-05 18:04:29 +0200
commit14e0b7d4ef1bbae9290e86f14c58a08b746270f2 (patch)
treedaa9fd486441b869969df92880117659b3b2730b /src/main.rs
parentMerge pull request 'don't accept cannot-be-a-base urls in parsing' (#123) fro... (diff)
downloadforgejo-cli-14e0b7d4ef1bbae9290e86f14c58a08b746270f2.tar.xz
forgejo-cli-14e0b7d4ef1bbae9290e86f14c58a08b746270f2.zip
fix: consistency among host names
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index f224abd..881bc40 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -223,6 +223,10 @@ fn ssh_url_parse(s: &str) -> Result<url::Url, url::ParseError> {
})
}
+fn host_with_port(url: &url::Url) -> &str {
+ &url[url::Position::BeforeHost..url::Position::AfterPort]
+}
+
use std::sync::OnceLock;
static SPECIAL_RENDER: OnceLock<SpecialRender> = OnceLock::new();