Skip to main content

parse_release

Function parse_release 

Source
pub fn parse_release(json: &str) -> Result<Release, String>
Expand description

Parse a release response into what the updater needs.

A draft or prerelease is an error rather than “not newer”: the tray shows the reason, and a silent skip would hide a mis-tagged release forever. Assets are filtered, not rejected wholesale — one odd file in a release must not block the update — but an asset whose name could escape the staging directory (a separator, ..) is dropped, as is one served from anywhere but HTTPS. html_url is the “open release notes” link, which only ever points at GitHub; anything else becomes an empty string so the tray simply shows no link.