Fix TOML parsing with large unsigned integers

The parser parses everything as signed integers so the configuration
file will fail to parse large numbers that don't fit in an i64.

https://github.com/alexcrichton/toml-rs/issues/256
This commit is contained in:
Robbert van der Helm
2020-07-27 16:25:36 +02:00
parent 81696f4dde
commit f02dbb3755
3 changed files with 14 additions and 2 deletions
+7 -1
View File
@@ -108,7 +108,13 @@ pub struct KnownConfig {
/// The results from running the contents of `yabridge-host.exe.so` through
/// [`DefaultHasher`](std::collections::hash_map::DefaultHasher). Hash collisions aren't really
/// an issue here since we mostly care about the version of Wine.
pub yabridge_host_hash: u64,
///
/// This should have been stored as a `u64`, but the TOML library parses all integers as signed
/// so even though it will be able to serialize all values correctly some values will fail to
/// parse:
///
/// https://github.com/alexcrichton/toml-rs/issues/256
pub yabridge_host_hash: i64,
}
impl Config {
+1 -1
View File
@@ -183,7 +183,7 @@ pub fn verify_wine_setup(config: &mut Config) -> Result<()> {
yabridge_host_exe_so_path.display()
)
})?);
let yabridge_host_hash = hasher.finish();
let yabridge_host_hash = hasher.finish() as i64;
// Since these checks can take over a second if wineserver isn't already running we'll only
// perform them when something has changed