Repository: GuillaumeGomez/sysinfo (rust)

Issue:
Remove `refresh_list` methods
It's not very coherent with how processes are refreshed. And now with https://github.com/GuillaumeGomez/sysinfo/pull/1404, it makes even less sense to have that. Better just refresh everything and keep the current items.

Pull request:
Rename `Users::refresh_list` and `Groups::refresh_list` into `refresh`
Fixes #1405.

Patch:
diff --git a/benches/basic.rs b/benches/basic.rs
index e764622..3a92a2d 100644
--- a/benches/basic.rs
+++ b/benches/basic.rs
@@ -127,6 +127,6 @@ fn bench_refresh_users_list(b: &mut test::Bencher) {
     let mut users = sysinfo::Users::new_with_refreshed_list();
 
     b.iter(move || {
-        users.refresh_list();
+        users.refresh();
     });
 }
diff --git a/examples/simple.rs b/examples/simple.rs
index c35a181..137eb57 100644
--- a/examples/simple.rs
+++ b/examples/simple.rs
@@ -163,7 +163,7 @@ fn interpret_input(
         }
         "refresh_users" => {
             writeln!(&mut io::stdout(), "Refreshing user list...");
-            users.refresh_list();
+            users.refresh();
             writeln!(&mut io::stdout(), "Done.");
         }
         "refresh_networks" => {
diff --git a/funding.json b/funding.json
deleted file mode 100644
index ca7b7d2..0000000
--- a/funding.json
+++ /dev/null
@@ -1,68 +0,0 @@
-{
-    "version": "v1.0.0",
-    "entity": {
-        "type": "individual",
-        "role": "owner",
-        "name": "Guillaume Gomez",
-        "email": "guillaume1.gomez@gmail.com",
-        "phone": "",
-        "description": "Contributor on multiple open-source projects in the Rust ecosystem, including the Rust compiler itself.",
-        "webpageUrl": {
-            "url": "https://github.com/GuillaumeGomez/sysinfo"
-        }
-    },
-    "projects": [
-        {
-            "guid": "sysinfo-crate",
-            "name": "sysinfo",
-            "description": "Cross-platform library to fetch system information.",
-            "webpageUrl": {
-                "url": "https://github.com/GuillaumeGomez/sysinfo"
-            },
-            "repositoryUrl": {
-                "url": "https://github.com/GuillaumeGomez/sysinfo"
-            },
-            "licenses": ["spdx:MIT"],
-            "tags": ["rust", "system", "CPU", "process"]
-        }
-    ],
-    "funding": {
-        "channels": [
-            {
-                "guid": "github-sponsors",
-                "type": "payment-provider",
-                "address": "https://github.com/sponsors/GuillaumeGomez",
-                "description": "Sponsor me through Github."
-            },
-            {
-                "guid": "paypal-sponsors",
-                "type": "payment-provider",
-                "address": "https://www.paypal.com/paypalme/imperioland",
-                "description": "Sponsor me through Paypal."
-            }
-        ],
-        "plans": [
-            {
-                "guid": "developer-time",
-                "status": "active",
-                "name": "Developer compensation",
-                "description": "This will cover the cost of one developer working part-time on the projects.",
-                "amount": 0,
-                "currency": "USD",
-                "frequency": "monthly",
-                "channels": ["github-sponsors", "paypal-sponsors"]
-            },
-            {
-                "guid": "support-plan",
-                "status": "active",
-                "name": "Support plan",
-                "description": "Pay anything you wish/can to show your support for the projects.",
-                "amount": 0,
-                "currency": "USD",
-                "frequency": "one-time",
-                "channels": ["github-sponsors", "paypal-sponsors"]
-            }
-        ],
-        "history": []
-    }
-}
diff --git a/src/common/user.rs b/src/common/user.rs
index b2db84a..4c54a0f 100644
--- a/src/common/user.rs
+++ b/src/common/user.rs
@@ -252,7 +252,7 @@ impl Users {
     /// use sysinfo::Users;
     ///
     /// let mut users = Users::new();
-    /// users.refresh_list();
+    /// users.refresh();
     /// for user in users.list() {
     ///     println!("{user:?}");
     /// }
@@ -262,7 +262,6 @@ impl Users {
     }
 
     /// Creates a new [`Users`][crate::Users] type with the user list loaded.
-    /// It is a combination of [`Users::new`] and [`Users::refresh_list`].
     ///
     /// ```no_run
     /// use sysinfo::Users;
@@ -274,7 +273,7 @@ impl Users {
     /// ```
     pub fn new_with_refreshed_list() -> Self {
         let mut users = Self::new();
-        users.refresh_list();
+        users.refresh();
         users
     }
 
@@ -312,9 +311,9 @@ impl Users {
     /// use sysinfo::Users;
     ///
     /// let mut users = Users::new();
-    /// users.refresh_list();
+    /// users.refresh();
     /// ```
-    pub fn refresh_list(&mut self) {
+    pub fn refresh(&mut self) {
         crate::sys::get_users(&mut self.users);
     }
 
@@ -424,7 +423,7 @@ impl Groups {
     /// use sysinfo::Groups;
     ///
     /// let mut groups = Groups::new();
-    /// groups.refresh_list();
+    /// groups.refresh();
     /// for group in groups.list() {
     ///     println!("{group:?}");
     /// }
@@ -434,7 +433,6 @@ impl Groups {
     }
 
     /// Creates a new [`Groups`][crate::Groups] type with the user list loaded.
-    /// It is a combination of [`Groups::new`] and [`Groups::refresh_list`].
     ///
     /// ```no_run
     /// use sysinfo::Groups;
@@ -446,7 +444,7 @@ impl Groups {
     /// ```
     pub fn new_with_refreshed_list() -> Self {
         let mut groups = Self::new();
-        groups.refresh_list();
+        groups.refresh();
         groups
     }
 
@@ -481,12 +479,12 @@ impl Groups {
     /// The group list will be emptied then completely recomputed.
     ///
     /// ```no_run
-    /// use sysinfo::Users;
+    /// use sysinfo::Groups;
     ///
-    /// let mut users = Users::new();
-    /// users.refresh_list();
+    /// let mut groups = Groups::new();
+    /// groups.refresh();
     /// ```
-    pub fn refresh_list(&mut self) {
+    pub fn refresh(&mut self) {
         crate::sys::get_groups(&mut self.groups);
     }
 }
@@ -499,7 +497,7 @@ mod tests {
     fn check_list() {
         let mut users = Users::new();
         assert!(users.list().is_empty());
-        users.refresh_list();
+        users.refresh();
         assert!(users.list().len() >= MIN_USERS);
     }
 
diff --git a/src/lib.rs b/src/lib.rs
index 35b6e01..1423fc7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -282,7 +282,7 @@ mod test {
     fn check_uid_gid() {
         let mut users = Users::new();
         assert!(users.list().is_empty());
-        users.refresh_list();
+        users.refresh();
         let user_list = users.list();
         assert!(user_list.len() >= MIN_USERS);
 


Test patch:
diff --git a/tests/users.rs b/tests/users.rs
index ac0cf45..78f09b0 100644
--- a/tests/users.rs
+++ b/tests/users.rs
@@ -17,7 +17,7 @@ fn test_users() {
     if sysinfo::IS_SUPPORTED_SYSTEM {
         let mut users = Users::new();
         assert_eq!(users.iter().count(), 0);
-        users.refresh_list();
+        users.refresh();
         assert!(users.iter().count() > 0);
         let count = users.first().unwrap().groups().iter().len();
         for _ in 1..10 {