Clippy fixes and documentation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -25,6 +25,8 @@ pub trait ScriptResolver: Debug {
|
||||
/// shared between all different usages.
|
||||
fn load_item_script(&self, _key: &dyn Item) -> Result<Option<Arc<dyn ItemScript>>>;
|
||||
|
||||
/// Returns a reference to this script resolver as an Any. This is used to downcast the
|
||||
/// ScriptResolver to a specific implementation.
|
||||
fn as_any(&self) -> &dyn std::any::Any;
|
||||
}
|
||||
|
||||
|
||||
@@ -378,6 +378,7 @@ impl Battle {
|
||||
}
|
||||
}
|
||||
|
||||
/// Gets the inner pointer to the reference counted data.
|
||||
pub fn as_ptr(&self) -> *const c_void {
|
||||
Arc::as_ptr(&self.data) as *const c_void
|
||||
}
|
||||
|
||||
@@ -354,6 +354,7 @@ impl BattleSide {
|
||||
}
|
||||
}
|
||||
|
||||
/// Gets the inner pointer to the reference counted data.
|
||||
pub fn as_ptr(&self) -> *const c_void {
|
||||
Arc::as_ptr(&self.data) as *const c_void
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ impl Pokemon {
|
||||
|
||||
/// Change the form of the Pokemon.
|
||||
pub fn change_form(&self, form: &Arc<dyn Form>) -> Result<()> {
|
||||
if Arc::ptr_eq(&self.form(), form) {
|
||||
if self.form().eq(form.deref()) {
|
||||
return Ok(());
|
||||
}
|
||||
*self.data.form.write() = form.clone();
|
||||
@@ -816,6 +816,7 @@ impl Pokemon {
|
||||
}
|
||||
}
|
||||
|
||||
/// Gets the inner pointer to the reference counted data.
|
||||
pub fn as_ptr(&self) -> *const c_void {
|
||||
Arc::as_ptr(&self.data) as *const c_void
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user