From a48471ce57bdcd80b0700f40b36b34030af89abe Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 29 Jun 2026 11:38:19 -0400 Subject: [PATCH] client: Remove unused `cached_user_by_github_login` method from `UserStore` (#60103) This PR removes the `cached_user_by_github_login` method from the `UserStore`, as it was unused. Release Notes: - N/A --- crates/client/src/user.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/crates/client/src/user.rs b/crates/client/src/user.rs index c05518cdba..a2a8bf18d2 100644 --- a/crates/client/src/user.rs +++ b/crates/client/src/user.rs @@ -108,7 +108,6 @@ pub enum ContactRequestStatus { pub struct UserStore { users: HashMap>, - by_github_login: HashMap, participant_indices: HashMap, update_contacts_tx: mpsc::UnboundedSender, edit_prediction_usage: Option, @@ -189,7 +188,6 @@ impl UserStore { Self { users: Default::default(), - by_github_login: Default::default(), current_user: current_user_rx, current_organization: None, organizations: Vec::new(), @@ -260,8 +258,6 @@ impl UserStore { cx.update(|cx| { if let Some((user, response)) = current_user_and_response { this.update(cx, |this, cx| { - this.by_github_login - .insert(user.github_login.clone(), user_id); this.users.insert(user_id, user); this.update_authenticated_user(response, cx) }) @@ -317,7 +313,6 @@ impl UserStore { #[cfg(feature = "test-support")] pub fn clear_cache(&mut self) { self.users.clear(); - self.by_github_login.clear(); } async fn handle_show_contacts( @@ -688,12 +683,6 @@ impl UserStore { }) } - pub fn cached_user_by_github_login(&self, github_login: &str) -> Option> { - self.by_github_login - .get(github_login) - .and_then(|id| self.users.get(id).cloned()) - } - pub fn current_user(&self) -> Option> { self.current_user.borrow().clone() } @@ -968,13 +957,7 @@ impl UserStore { let mut ret = Vec::with_capacity(users.len()); for user in users { let user = User::new(user); - if let Some(old) = self.users.insert(user.legacy_id, user.clone()) - && old.github_login != user.github_login - { - self.by_github_login.remove(&old.github_login); - } - self.by_github_login - .insert(user.github_login.clone(), user.legacy_id); + self.users.insert(user.legacy_id, user.clone()); ret.push(user) } ret