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

This commit is contained in:
Deukhoofd committed 2023-01-02 10:41:57 +01:00
1 parent 0a4d44646c
commit 27b0a460ad
4 files changed
+5 -5

No files matched your search

+1 -1
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"
+2 -2
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);
}
+1 -1
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();
}
+1 -1
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)]