polyphony-chat / chorus

A Rust library for interacting with multiple Polyphony- and Spacebar-Compatible instances at once.
https://crates.io/crates/chorus
Mozilla Public License 2.0
16 stars 7 forks source link

Derives #526

Closed bitfl0wer closed 1 month ago

bitfl0wer commented 1 month ago

Adds about one billion (+- a few hundred million) missing derives for all sorts of types.

The biggest change in this PR is, how structs holding a property Shared<T> types implement PartialEq. In previous versions of this crate, if a Shared<T> was part of a struct, this or these properties would be ignored in == comparisons. This is because Shared<T> is defined as Arc<RwLock<T>> - meaning you'd have to lock the RwLock to make a comparison. From now on, instead of ignoring these properties or locking the inner RwLock, the pointer values of the Arc<T>'s get compared. This is a cheap and exact way of ensuring Eq for types, which have an inner Shared<T>.