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/wrangler-legacy/src/version
    
    the code of the file until where you have to start completion: use std::fs;
use std::path::Path;
use std::str::FromStr;
use std::time::SystemTime;

use crate::settings::get_wrangler_home_dir;
use crate::terminal::message::{Message, StdOut};
use crate::terminal::styles;

use anyhow::Result;
use reqwest::header::USER_AGENT;
use semver::Version;
use serde::{Deserialize, Serialize};

const ONE_DAY: u64 = 60 * 60 * 24;

pub fn check_for_updates() {
    let major_version_message = String::from("A new major version of wrangler is available!\n");
    let minor_version_message = match check_wrangler_versions() {
        Err(e) => {
            log::debug!("could not determine if update is needed:\n{}", e);
            None

    
fn check_wrangler_versions() -> Result<WranglerVersion> {
    let config_dir = get_wrangler_home_dir();
    let version_file = config_dir.join("version.toml");
    let current_time = SystemTime::now();

    let mut checked = false;
    let current = get_installed_version()?;

    let latest = match get_version_disk(&version_file) {
        Some(last_checked_version) => {
            let time_since_last_checked =
                current_time.duration_since(last_checked_version.last_checked)?;

            if time_since_last_checked.as_secs() < ONE_DAY {
                checked = true;
                Version::parse(&last_checked_version.latest_version)?
            } else {
                get_latest_version(&current.to_string(), &version_file, current_time)?
            }
        }
        // If version.toml doesn't exist, fetch latest version
        None => get_latest_version(&current.to_string(), &version_file, current_time)?,
    };

    Ok(WranglerVersion {
        current,
        latest,
        checked,
    })
}