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: mod.rs
    path of file: ./repos/wasmer/lib/registry/src/package
    
    the code of the file until where you have to start completion: #[cfg(feature = "build-package")]
pub mod builder;

use crate::WasmerConfig;
use regex::Regex;
use std::path::{Path, PathBuf};
use std::{fmt, str::FromStr};
use url::Url;

const REGEX_PACKAGE_WITH_VERSION: &str =
    r"^([a-zA-Z0-9\-_]+)/([a-zA-Z0-9\-_]+)(@([a-zA-Z0-9\.\-_]+*))?$";

lazy_static::lazy_static! {
    static ref PACKAGE_WITH_VERSION: Regex = regex::Regex::new(REGEX_PACKAGE_WITH_VERSION).unwrap();
}

#[derive(Debug, Default, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct Package {
   
    
    pub fn is_url_already_installed(url: &Url, wasmer_dir: &Path) -> Option<PathBuf> {
        let checkouts_dir = crate::get_checkouts_dir(wasmer_dir);

        let url_string = url.to_string();
        let (url, version) = match url_string.split('@').collect::<Vec<_>>()[..] {
            [url, version] => (url.to_string(), Some(version)),
            _ => (url_string, None),
        };
        let hash = Self::hash_url(&url);
        let found = std::fs::read_dir(&checkouts_dir)
            .ok()?
            .filter_map(|e| Some(e.ok()?.file_name().to_str()?.to_string()))
            .find(|s| match version.as_ref() {
                None => s.contains(&hash),
                Some(v) => s.contains(&hash) && s.ends_with(v),
            })?;
        Some(checkouts_dir.join(found))
    }