Function print_check

Source
pub fn print_check(name: &str, current_version: &str, source: Source)
Expand description

Prints update information for a package from the specified source.

This is a convenience function that checks for updates and prints the result directly to stdout if an update is available.

§Arguments

  • name - The name of the package to check
  • current_version - The current version string (e.g., “1.0.0”)
  • source - The source to check for updates

§Examples

use update_available::{print_check, Source};

// Check crates.io
print_check("serde", "1.0.0", Source::CratesIo);

// Check GitHub
print_check("my-repo", "0.1.0", Source::Github("username".to_string()));

// Check Gitea
print_check("my-repo", "0.1.0", Source::Gitea("username".to_string(), "https://gitea.example.com".to_string()));