Fixes for newer Rust nightly
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2023-01-02 10:41:57 +01:00
parent 0a4d44646c
commit 27b0a460ad
4 changed files with 5 additions and 5 deletions

View File

@@ -600,7 +600,7 @@ impl Pokemon {
/// Whether or not the Pokemon is on the battlefield.
pub fn is_on_battlefield(&self) -> bool {
self.battle_data.read().is_some_and(|a| a.on_battle_field())
self.battle_data.read().as_ref().is_some_and(|a| a.on_battle_field())
}
/// Marks an opponent as seen, for use in experience gain.
@@ -636,7 +636,7 @@ impl Pokemon {
});
}
}
if self.battle_data.read().is_some_and(|a| a.on_battle_field()) {
if self.battle_data.read().as_ref().is_some_and(|a| a.on_battle_field()) {
script_hook!(on_damage, self, self, source, self.current_health(), new_health);
}

View File

@@ -302,7 +302,7 @@ impl ScriptContainer {
/// Get the internal script. Note that this can only be None if the script was marked for deletion.
pub fn get(&self) -> Option<&ScriptHolder> {
if self.script.read().is_some_and(|a| a.is_marked_for_deletion()) {
if self.script.read().as_ref().is_some_and(|a| a.is_marked_for_deletion()) {
if !self.script.is_locked() {
self.script.write().take();
}

View File

@@ -7,7 +7,7 @@
#![feature(test)]
#![feature(once_cell)]
#![feature(const_option)]
#![feature(is_some_with)]
#![feature(is_some_and)]
#![feature(new_uninit)]
#![feature(get_mut_unchecked)]
#![feature(strict_provenance)]