Added dictionary plugin and switched from a Mutex to an RwLock in the anyrun_plugin crate

This change means that `get_matches` no longer has access to a mutable version of the
state of the plugin. A redesign is needed to allow for this if needed.
This commit is contained in:
Kirottu
2023-04-29 18:18:47 +03:00
parent 3a1648cf37
commit beaf2549ac
13 changed files with 162 additions and 31 deletions

View File

@@ -98,7 +98,7 @@ pub fn handler(_match: Match, state: &mut State) -> HandleResult {
}
}
pub fn get_matches(input: RString, state: &mut State) -> RVec<Match> {
pub fn get_matches(input: RString, state: &State) -> RVec<Match> {
if !input.starts_with(&state.config.prefix) {
return RVec::new();
}