aboutsummaryrefslogtreecommitdiff
path: root/src/internal/rwlock_ext.rs
Commit message (Collapse)AuthorAgeFilesLines
* Switch to parking_lot::{Mutex, RwLock}Zeyla Hellyer2017-10-101-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to the `parking_lot` crate's implementations of `std::sync::Mutex` and `std::sync::RwLock`, which are more efficient. A writeup on why `parking_lot` is more efficient can be read here: <https://github.com/Amanieu/parking_lot> Upgrade path: Modify `mutex.lock().unwrap()` usage to `mutex.lock()` (not needing to unwrap or handle a result), and `rwlock.read().unwrap()`/`rwlock.write().unwrap()` usage to `rwlock.read()` and `rwlock.write()`. For example, modify: ```rust use serenity::CACHE; println!("{}", CACHE.read().unwrap().user.id); ``` to: ```rust use serenity::CACHE; println!("{}", CACHE.read().user.id); ```
* Revamp `RwLock` usage in the libacdenisSK2017-08-241-0/+18
Also not quite sure if they goofed rustfmt or something, but its changes it did were a bit bizarre.