mirror of
https://github.com/talwat/lowfi
synced 2024-12-26 19:21: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.
|
// Basically just read from the volume file if it exists, otherwise return 100.
|
||||||
let volume = if volume.exists() {
|
let volume = if volume.exists() {
|
||||||
let contents = fs::read_to_string(volume).await?;
|
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
|
stripped
|
||||||
.parse()
|
.parse()
|
||||||
.map_err(|_| eyre!("volume.txt file is invalid"))?
|
.map_err(|_| eyre!("volume.txt file is invalid"))?
|
||||||
|
Loading…
Reference in New Issue
Block a user