Update src/local_state.rs

Co-authored-by: Noah Lev <camelidcamel@gmail.com>
This commit is contained in:
Micha Reiser 2024-07-27 17:24:08 +01:00 committed by GitHub
parent 18faece05e
commit 354dc0eff1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -86,7 +86,7 @@ impl LocalState {
let new_db = NonNull::from(db);
// Already attached? Assert that the database has not changed.
// NOTE: It's important to use `addr_eq` here because `NonNull` not only compares the address but also the type's metadata.
// NOTE: It's important to use `addr_eq` here because `NonNull::eq` not only compares the address but also the type's metadata.
if !std::ptr::addr_eq(current_db.as_ptr(), new_db.as_ptr()) {
panic!(
"Cannot change database mid-query. current: {current_db:?}, new: {new_db:?}",