You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: gitinfo.rs
    path of file: ./repos/orogene/crates/oro-package-spec/src
    
    the code of the file until where you have to start completion: use std::fmt;
use std::str::FromStr;

use node_semver::Range;
use nom::combinator::all_consuming;
use nom::Err;
use url::Url;

use crate::error::{PackageSpecError, SpecErrorKind};
use crate::parsers::git;
use crate::PackageSpec;

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum GitHost {
    GitHub,
    Gist,
    GitLab,
    Bitbucket,
}

impl FromStr for GitHost {
    type Err = PackageSpecError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s.to_lowercase().as_str() {
            "github" => GitHost::GitHub,
            "gist" => GitHost::Gist,
            "gitlab" => GitHost::GitLab,
            "bitbucket" => GitHost::Bitbucket,
            _ => {
                return Err(PackageSpecError {
                    input: s.into(),
                    offset: 0,
                    kind: SpecErrorKind::InvalidGitHost(s.into()),
                })
            }
        })
    }
}

impl fmt::Display for GitHost {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        use GitHost::*;
        write!(
            f,
            "{}",
            match self {
                GitHub => "gith
    
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        use GitInfo::*;
        match self {
            GitInfo::Url {
                url,
                committish,
                semver,
            } => {
                if url.scheme() != "git" {
                    write!(f, "git+")?;
                }
                write!(f, "{url}")?;
                if let Some(comm) = committish {
                    write!(f, "#{comm}")?;
                } else if let Some(semver) = semver {
                    write!(f, "#semver:{semver}")?;
                }
            }
            Ssh {
                ssh,
                committish,
                semver,
            } => {
                write!(f, "git+ssh://{ssh}")?;
                if let Some(comm) = committish {
                    write!(f, "#{comm}")?;
                } else if let Some(semver) = semver {
                    write!(f, "#semver:{semver}")?;
                }
            }
            Hosted {
                requested,
                owner,
                repo,
                host,
                committish,
                semver,
            } => {
                if let Some(requested) = requested {
                    if !requested.starts_with("git://") {
                        write!(f, "git+")?;
                    }
                    write!(f, "{requested}")?;
                } else {
                    write!(f, "{host}:{owner}/{repo}")?;
                }

                if let Some(comm) = committish {
                    write!(f, "#{comm}")?;
                } else if let Some(semver) = semver {
                    write!(f, "#semver:{semver}")?;
                }
            }
        }
        Ok(())
    }