Update doc-comments.

This commit is contained in:
Stephen Chung 2021-08-24 12:04:53 +08:00
parent db3049e574
commit 2a760eb44b

View File

@ -21,7 +21,6 @@ use crate::Array;
#[cfg(not(feature = "no_object"))] #[cfg(not(feature = "no_object"))]
use crate::Map; use crate::Map;
/// Engine public API
impl Engine { impl Engine {
/// Register a custom function with the [`Engine`]. /// Register a custom function with the [`Engine`].
/// ///
@ -194,7 +193,6 @@ impl Engine {
/// ///
/// impl TestStruct { /// impl TestStruct {
/// fn new() -> Self { Self { field: 1 } } /// fn new() -> Self { Self { field: 1 } }
///
/// fn update(&mut self, offset: i64) { self.field += offset; } /// fn update(&mut self, offset: i64) { self.field += offset; }
/// } /// }
/// ///
@ -295,7 +293,6 @@ impl Engine {
/// ///
/// impl TestStruct { /// impl TestStruct {
/// fn new() -> Self { Self { field: 1 } } /// fn new() -> Self { Self { field: 1 } }
///
/// // Even a getter must start with `&mut self` and not `&self`. /// // Even a getter must start with `&mut self` and not `&self`.
/// fn get_field(&mut self) -> i64 { self.field } /// fn get_field(&mut self) -> i64 { self.field }
/// } /// }
@ -343,7 +340,6 @@ impl Engine {
/// ///
/// impl TestStruct { /// impl TestStruct {
/// fn new() -> Self { Self { field: 1 } } /// fn new() -> Self { Self { field: 1 } }
///
/// // Even a getter must start with `&mut self` and not `&self`. /// // Even a getter must start with `&mut self` and not `&self`.
/// fn get_field(&mut self) -> Result<i64, Box<EvalAltResult>> { /// fn get_field(&mut self) -> Result<i64, Box<EvalAltResult>> {
/// Ok(self.field) /// Ok(self.field)
@ -387,7 +383,6 @@ impl Engine {
/// ///
/// impl TestStruct { /// impl TestStruct {
/// fn new() -> Self { Self { field: 1 } } /// fn new() -> Self { Self { field: 1 } }
///
/// fn set_field(&mut self, new_val: i64) { self.field = new_val; } /// fn set_field(&mut self, new_val: i64) { self.field = new_val; }
/// } /// }
/// ///
@ -436,7 +431,6 @@ impl Engine {
/// ///
/// impl TestStruct { /// impl TestStruct {
/// fn new() -> Self { Self { field: 1 } } /// fn new() -> Self { Self { field: 1 } }
///
/// fn set_field(&mut self, new_val: i64) -> Result<(), Box<EvalAltResult>> { /// fn set_field(&mut self, new_val: i64) -> Result<(), Box<EvalAltResult>> {
/// self.field = new_val; /// self.field = new_val;
/// Ok(()) /// Ok(())
@ -487,10 +481,8 @@ impl Engine {
/// ///
/// impl TestStruct { /// impl TestStruct {
/// fn new() -> Self { Self { field: 1 } } /// fn new() -> Self { Self { field: 1 } }
///
/// // Even a getter must start with `&mut self` and not `&self`. /// // Even a getter must start with `&mut self` and not `&self`.
/// fn get_field(&mut self) -> i64 { self.field } /// fn get_field(&mut self) -> i64 { self.field }
///
/// fn set_field(&mut self, new_val: i64) { self.field = new_val; } /// fn set_field(&mut self, new_val: i64) { self.field = new_val; }
/// } /// }
/// ///
@ -543,7 +535,6 @@ impl Engine {
/// ///
/// impl TestStruct { /// impl TestStruct {
/// fn new() -> Self { Self { fields: vec![1, 2, 3, 4, 5] } } /// fn new() -> Self { Self { fields: vec![1, 2, 3, 4, 5] } }
///
/// // Even a getter must start with `&mut self` and not `&self`. /// // Even a getter must start with `&mut self` and not `&self`.
/// fn get_field(&mut self, index: i64) -> i64 { self.fields[index as usize] } /// fn get_field(&mut self, index: i64) -> i64 { self.fields[index as usize] }
/// } /// }
@ -617,7 +608,6 @@ impl Engine {
/// ///
/// impl TestStruct { /// impl TestStruct {
/// fn new() -> Self { Self { fields: vec![1, 2, 3, 4, 5] } } /// fn new() -> Self { Self { fields: vec![1, 2, 3, 4, 5] } }
///
/// // Even a getter must start with `&mut self` and not `&self`. /// // Even a getter must start with `&mut self` and not `&self`.
/// fn get_field(&mut self, index: i64) -> Result<i64, Box<EvalAltResult>> { /// fn get_field(&mut self, index: i64) -> Result<i64, Box<EvalAltResult>> {
/// Ok(self.fields[index as usize]) /// Ok(self.fields[index as usize])
@ -691,7 +681,6 @@ impl Engine {
/// ///
/// impl TestStruct { /// impl TestStruct {
/// fn new() -> Self { Self { fields: vec![1, 2, 3, 4, 5] } } /// fn new() -> Self { Self { fields: vec![1, 2, 3, 4, 5] } }
///
/// fn set_field(&mut self, index: i64, value: i64) { self.fields[index as usize] = value; } /// fn set_field(&mut self, index: i64, value: i64) { self.fields[index as usize] = value; }
/// } /// }
/// ///
@ -765,7 +754,6 @@ impl Engine {
/// ///
/// impl TestStruct { /// impl TestStruct {
/// fn new() -> Self { Self { fields: vec![1, 2, 3, 4, 5] } } /// fn new() -> Self { Self { fields: vec![1, 2, 3, 4, 5] } }
///
/// fn set_field(&mut self, index: i64, value: i64) -> Result<(), Box<EvalAltResult>> { /// fn set_field(&mut self, index: i64, value: i64) -> Result<(), Box<EvalAltResult>> {
/// self.fields[index as usize] = value; /// self.fields[index as usize] = value;
/// Ok(()) /// Ok(())
@ -842,10 +830,8 @@ impl Engine {
/// ///
/// impl TestStruct { /// impl TestStruct {
/// fn new() -> Self { Self { fields: vec![1, 2, 3, 4, 5] } } /// fn new() -> Self { Self { fields: vec![1, 2, 3, 4, 5] } }
///
/// // Even a getter must start with `&mut self` and not `&self`. /// // Even a getter must start with `&mut self` and not `&self`.
/// fn get_field(&mut self, index: i64) -> i64 { self.fields[index as usize] } /// fn get_field(&mut self, index: i64) -> i64 { self.fields[index as usize] }
///
/// fn set_field(&mut self, index: i64, value: i64) { self.fields[index as usize] = value; } /// fn set_field(&mut self, index: i64, value: i64) { self.fields[index as usize] = value; }
/// } /// }
/// ///