fn extract_endpoint(url: &Url) -> azure_core::Result<String> {
    let endpoint = url
        .host_str()
        .ok_or_else(|| {
            Error::with_message(ErrorKind::DataConversion, || {
                format!("could not get device update domain. url: {url}")
            })
        })?
        .split_once('.')
        .ok_or_else(|| {
            Error::with_message(ErrorKind::DataConversion, || {
                format!("could not parse device update domain. url: {url}")
            })
        })?
        .1;
    Ok(format!("{}://{}", url.scheme(), endpoint))
}
/// Helper to get vault endpoint with a scheme and a trailing slash
/// ex. `https://vault.azure.net/` where the full client url is `https://myvault.vault.azure.net`
Helper to get vault endpoint with a scheme and a trailing slash
ex.
Helper to get vault endpoint with a scheme and a trailing slash ex .
fn extract_endpoint(url: &Url) -> azure_core::Result<String> {
    let endpoint = url
        .host_str()
        .ok_or_else(|| {
            Error::with_message(ErrorKind::DataConversion, || {
                format!("could not get device update domain. url: {url}")
            })
        })?
        .split_once('.')
        .ok_or_else(|| {
            Error::with_message(ErrorKind::DataConversion, || {
                format!("could not parse device update domain. url: {url}")
            })
        })?
        .1;
    Ok(format!("{}://{}", url.scheme(), endpoint))
}
fn extract_endpoint ( url : & Url ) -> azure_core :: Result < String > { let endpoint = url . host_str ( ) . ok_or_else ( | | { Error :: with_message ( ErrorKind :: DataConversion , | | { format ! ( " " ) } ) } ) ? . split_once ( '.' ) . ok_or_else ( | | { Error :: with_message ( ErrorKind :: DataConversion , | | { format ! ( " " ) } ) } ) ? . 1 ; Ok ( format ! ( " " url scheme ( ) endpoint ) ) }
Helper to get vault endpoint with a scheme and a trailing slash
ex.
Helper to get vault endpoint with a scheme and a trailing slash ex .
url
&Url