summary history branches tags files
commit:8dd2caafb012d59e9cdbf5feef7837e846fa5c42
author:quantum-byte
committer:Trevor Bentley
date:Tue Feb 14 20:32:36 2023 +0100
parents:0e58c1b1864e007ee2d9163f6b0fefc6887df12f
changed users output to Hashset for easy deduplication
diff --git a/src/main.rs b/src/main.rs
line changes: +3/-1
index 665155d..1a63192
--- a/src/main.rs
+++ b/src/main.rs
@@ -21,6 +21,8 @@
  * along with Circadian.  If not, see <http://www.gnu.org/licenses/>.
  */
 extern crate regex;
+
+use std::collections::HashSet;
 use regex::Regex;
 
 extern crate glob;
@@ -540,7 +542,7 @@ fn exist_audio_pulseaudio() -> ExistResult {
     let users_stdout = users_output
         .map_err(| _ | CircadianError("users failed".to_string()));
     let users_output_str = String::from_utf8(users_stdout?.stdout)?;
-    let active_users: Vec<&str> = users_output_str.split(" ")
+    let active_users: HashSet<&str> = users_output_str.split(" ")
         .filter(|l| l.len() > 0)
         .collect();