mirror of
https://github.com/talwat/lowfi
synced 2024-12-25 18:51:54 +00:00
fix: trim whitespace from volume contents (#16)
This commit is contained in:
parent
d9ba0c3b3b
commit
5b546ea2de
@ -44,7 +44,7 @@ impl InitialProperties {
|
||||
// Basically just read from the volume file if it exists, otherwise return 100.
|
||||
let volume = if volume.exists() {
|
||||
let contents = fs::read_to_string(volume).await?;
|
||||
let stripped = contents.strip_suffix("%").unwrap_or(&contents);
|
||||
let stripped = contents.trim().strip_suffix("%").unwrap_or(&contents);
|
||||
stripped
|
||||
.parse()
|
||||
.map_err(|_| eyre!("volume.txt file is invalid"))?
|
||||
|
Loading…
Reference in New Issue
Block a user