don't
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore(knot): remove unused source file

tjh d2db43d2 9e0769a4

-41
-41
crates/gordian-knot/src/public/git/protocol.rs
··· 1 - use axum::extract::OptionalFromRequestParts; 2 - use std::convert::Infallible; 3 - 4 - /// Extract the "Git-Protocol" header from a request. 5 - #[derive(Debug)] 6 - pub struct GitProtocol(pub Box<str>); 7 - 8 - impl AsRef<str> for GitProtocol { 9 - #[inline] 10 - fn as_ref(&self) -> &str { 11 - &self.0 12 - } 13 - } 14 - 15 - impl std::ops::Deref for GitProtocol { 16 - type Target = str; 17 - 18 - #[inline] 19 - fn deref(&self) -> &Self::Target { 20 - &self.0 21 - } 22 - } 23 - 24 - impl<S> OptionalFromRequestParts<S> for GitProtocol 25 - where 26 - S: Sync, 27 - { 28 - type Rejection = Infallible; 29 - 30 - async fn from_request_parts( 31 - parts: &mut axum::http::request::Parts, 32 - _: &S, 33 - ) -> Result<Option<Self>, Self::Rejection> { 34 - let header_value = parts 35 - .headers 36 - .get("Git-Protocol") 37 - .and_then(|header| header.to_str().ok()); 38 - 39 - Ok(header_value.map(|value| Self(value.into()))) 40 - } 41 - }