mgrachev / update-informer

Update informer for CLI/GUI applications written in Rust 🦀
MIT License
209 stars 8 forks source link

Document usage without crate's cache file #143

Closed Enyium closed 1 month ago

Enyium commented 2 months ago

My GUI app uses its own JSON config file to keep track of whether an update check should be performed. According to my understanding of the following code snippet, calling update_informer::new(...).interval(Duration::ZERO) is the way to achieve this:

        // If the interval is zero, don't use the cache file
        let latest_version = if self.interval.is_zero() {
            match R::get_latest_version(client, &pkg)? {
                Some(v) => v,
                None => return Ok(None),
            }
        } else {

But this isn't documented. Could you please document this usage as a way to completely avoid that the crate does anything on the file system, if I understood this correctly?

BTW: The docs text on interval() says: "An interval in seconds." But it's a Duration, which isn't a second value per se.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Enyium commented 1 month ago

@mgrachev, please react.

mgrachev commented 1 month ago

@Enyium 👋 Thank you for your feedback!

Any PR to improve the documentation is welcome 😊