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 364b47f commit 73e6db8
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 @@ -1245,7 +1245,7 @@ fn main() -> Result<(), Box<dyn Error>> {
// Get filesystem information
println!("\nFilesystems:");
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 fs_str = String::from_utf8(output.stdout)?;
for line in fs_str.lines().skip(1) {
Expand Down

0 comments on commit 73e6db8

Please sign in to comment.