mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 04:50:36 +00:00
Fix using instances as keys in tables
This commit is contained in:
parent
a21cfc5297
commit
cc3772680f
2 changed files with 13 additions and 0 deletions
|
@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## Unreleased
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed using instances as keys in tables
|
||||
|
||||
## `0.6.5` - March 27th, 2023
|
||||
|
||||
### Changed
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use std::{
|
||||
collections::{BTreeMap, HashMap, VecDeque},
|
||||
fmt,
|
||||
hash::{Hash, Hasher},
|
||||
sync::RwLock,
|
||||
};
|
||||
|
||||
|
@ -1136,6 +1137,12 @@ impl LuaUserData for Instance {
|
|||
}
|
||||
}
|
||||
|
||||
impl Hash for Instance {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
self.dom_ref.hash(state)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Instance {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(
|
||||
|
|
Loading…
Reference in a new issue