check-latest 0.1.0

Check if your rust executable is the latest available version
Documentation

check-latest

Build Status

Check if your rust executable is the latest available version on Crates.io

The Basics

if let Ok(Some(version)) = max_version!() {
    println!("We've released a new version: {}!", version);
}

Notes

Using this library in your

Rust Library Rust Binary
:nauseated_face: :+1:

If you use this library for your binary, you should probably make this an optional feature. Simply checking for the latest version on Crates.io brings over a lot of dependencies in order to send a request to the API and parse the response. Some users may want to turn off this feature for a smaller binary. Some may simply prefer not to be told to install an update.

You can make this feature optional by adding this to your Cargo.toml.

[dependencies]
check-latest = { version = "*", optional = true }

You can then selectively compile the parts of your binary that check for later releases with this attribute to the parts that should be compiled if this feature is enabled.

#[cfg(feature = "check-latest")]