Skip to content

Conversation

@comprido96
Copy link

Proposal: refactor UserStore add_user method signature to take an immutable reference to self, i.e. &self instead of &mut self,
moving the RwLock from UserStore trait into concrete implementations:

app_state.rs:
#[derive(Clone)]
pub struct UserStoreType(pub Arc<Box>);

hashmap_user_store.rs:
#[derive(Default)]
pub struct HashmapUserStore {
users: RwLock<HashMap<String, User>>,
}

See last commit: comprido96@1f7e79c#diff-afd280d500d88b598001a76068239f3fa07150812b4f0883d3ce73e697f8ef57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant