Fixes for newer Rust nightly
continuous-integration/drone/push Build is failing Details

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

View File

@ -62,7 +62,7 @@ enum-display-derive = "0.1.1"
[dev-dependencies]
csv = "1.1.6"
project-root = "0.2.2"
datatest = "0.7.1"
datatest = { git = "https://github.com/Deukhoofd/datatest.git" }
serde_yaml = "0.9.14"
serde_json = "1.0.81"
serde_plain = "1.0.0"

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)]