Skip to content

Commit

Permalink
fix: correct filesystem information collection
Browse files Browse the repository at this point in the history
* Fix get_filesystems function:
  - Add missing vector initialization
  - Replace println! with vector collection
  - Properly return collected filesystem information
  - Maintain consistent formatting

This fixes the function to properly collect and return filesystem
information instead of just printing it. The function now correctly
fulfills its return type of Result<Vec<String>, Box<dyn Error>>.
  • Loading branch information
kennethdsheridan committed Nov 6, 2024
1 parent f7f0de4 commit 364b47f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ impl ServerInfo {
/// Gets filesystem information
fn get_filesystems() -> Result<Vec<String>, Box<dyn Error>> {
let output = Command::new("df")
.args(&["-h", "--output=source,fstype,size,used,avail,target"])
.args(["-h", "--output=source,fstype,size,used,avail,target"])
.output()?;

let output_str = String::from_utf8(output.stdout)?;
Expand Down

0 comments on commit 364b47f

Please sign in to comment.