Skip to content

Commit

Permalink
Fix compile errors after switching back from Nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
willemw12 committed Jul 19, 2020
1 parent 02b18da commit 5e3a28b
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/btrfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ use anyhow::{bail, ensure, Context, Result};
use regex::Regex;
use std::process::{Command, Stdio};

/// Human readable data usage (e.g., 1K 234M 2G).
#[derive(Clone, Debug)]
struct UsageHuman {
free: String,
free_min: String,
}

/// Raw data usage in bytes.
/// Raw Btrfs data usage in bytes.
#[derive(Debug)]
struct UsageRaw {
device_size: u64,
free: u64,
}

/// Human readable Btrfs data usage (e.g., 1K 234M 2G).
#[derive(Clone, Debug)]
struct UsageHuman {
free: String,
free_min: String,
}

/// Returns a warning if Btrfs data usage drops below the free limit percentage.
pub fn btrfs_usage(path: &str, free_limit_percentage: u64) -> Result<Option<String>> {
let usage_raw = usage_raw(path)?;
Expand Down Expand Up @@ -114,10 +114,7 @@ fn extract_usage_raw(buf: &str) -> Result<UsageRaw> {
bail!("usage data parse error");
}

Ok(UsageRaw {
device_size: device_size,
free: free,
})
Ok(UsageRaw { device_size, free })
}

fn extract_usage_human(buf: &str) -> Result<UsageHuman> {
Expand Down

0 comments on commit 5e3a28b

Please sign in to comment.