Skip to content

Commit

Permalink
fies for rust_allchecks.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
hanepjiv committed Dec 1, 2024
1 parent be1189a commit 7d0fcc9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 37 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# =============================================================================
[package]
name = "elicit"
version = "0.12.3-alpha.1"
version = "0.12.3-alpha.2"
publish = false

keywords = ["utility"]
Expand Down
28 changes: 14 additions & 14 deletions examples/aelicit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// @author hanepjiv <[email protected]>
// @copyright The MIT License (MIT) / Apache License Version 2.0
// @since 2024/04/14
// @date 2024/09/11
// @date 2024/12/01

// ////////////////////////////////////////////////////////////////////////////
// use =======================================================================
Expand All @@ -28,9 +28,9 @@ pub(crate) mod mine {
// ========================================================================
#[derive(Debug, Default, Clone, Aelicit)]
#[aelicit_mod_author(mine_aelicit::author)]
pub struct MineX {}
pub struct X {}
// ------------------------------------------------------------------------
impl Mine for MineX {
impl Mine for X {
fn action(&self) -> i32 {
0i32
}
Expand All @@ -39,22 +39,22 @@ pub(crate) mod mine {
#[derive(Debug, Clone, Aelicit)]
#[aelicit_mod_author(mine_aelicit::author)]
//#[aelicit_from_self_field(_fsf)] // here
pub struct MineY {
pub struct Y {
#[aelicit_from_self_field] // or here
_fsf: mine_aelicit::author::AelicitFromSelfField,
i: i32,
}
// ------------------------------------------------------------------------
impl MineY {
impl Y {
pub(crate) fn new(a: i32) -> Self {
Self {
_fsf: Default::default(),
_fsf: mine_aelicit::author::AelicitFromSelfField::default(),
i: a,
}
}
}
// ------------------------------------------------------------------------
impl Mine for MineY {
impl Mine for Y {
fn action(&self) -> i32 {
self.i
}
Expand Down Expand Up @@ -148,10 +148,10 @@ mod error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match *self {
Error::Elicit(ref e) => Some(e),
Error::AelicitLockRead(_) => None,
Error::AelicitLockWrite(_) => None,
Error::AelicitTryLockRead(_) => None,
Error::AelicitTryLockWrite(_) => None,
Error::AelicitLockRead(_)
| Error::AelicitLockWrite(_)
| Error::AelicitTryLockRead(_)
| Error::AelicitTryLockWrite(_) => None,
}
}
}
Expand All @@ -164,11 +164,11 @@ mod error {
// ============================================================================
fn main() -> elicit::Result<()> {
use mine::aelicit_user::Aelicit as MineAelicit;
use mine::{MineX, MineY};
use mine::{X, Y};

let mut e: MineAelicit;

e = MineAelicit::new(MineX::default())?;
e = MineAelicit::new(X::default())?;

if let Err(x) = e.with(|m| -> error::Result<'_, ()> {
println!("{m:?}");
Expand All @@ -178,7 +178,7 @@ fn main() -> elicit::Result<()> {
eprintln!("{x:?}");
}

let y = MineY::new(2);
let y = Y::new(2);
e = MineAelicit::new(y)?;

if let Err(e) = e.try_with(|m| -> error::Result<'_, ()> {
Expand Down
20 changes: 10 additions & 10 deletions examples/elicit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// @author hanepjiv <[email protected]>
// @copyright The MIT License (MIT) / Apache License Version 2.0
// @since 2024/04/13
// @date 2024/09/11
// @date 2024/12/01

// ////////////////////////////////////////////////////////////////////////////
// use =======================================================================
Expand All @@ -29,9 +29,9 @@ pub(crate) mod mine {
// ========================================================================
#[derive(Debug, Default, Clone, Elicit)]
#[elicit_mod_author(mine_elicit::author)]
pub struct MineX {}
pub struct X {}
// ------------------------------------------------------------------------
impl Mine for MineX {
impl Mine for X {
fn action(&self) -> i32 {
0i32
}
Expand All @@ -40,22 +40,22 @@ pub(crate) mod mine {
#[derive(Debug, Clone, Elicit)]
#[elicit_mod_author(mine_elicit::author)]
// #[elicit_from_self_field(_fsf)] // here
pub struct MineY {
pub struct Y {
#[elicit_from_self_field] // or here
_fsf: mine_elicit::author::ElicitFromSelfField,
i: i32,
}
// ------------------------------------------------------------------------
impl MineY {
impl Y {
pub(crate) fn new(a: i32) -> Self {
Self {
_fsf: Default::default(),
_fsf: mine_elicit::author::ElicitFromSelfField::default(),
i: a,
}
}
}
// ------------------------------------------------------------------------
impl Mine for MineY {
impl Mine for Y {
fn action(&self) -> i32 {
self.i
}
Expand All @@ -65,11 +65,11 @@ pub(crate) mod mine {
// ============================================================================
fn main() -> elicit::Result<()> {
use mine::elicit_user::Elicit as MineElicit;
use mine::{MineX, MineY};
use mine::{X, Y};

let mut e: MineElicit;

e = MineElicit::new(MineX::default())?;
e = MineElicit::new(X::default())?;

e.try_with(|m| -> elicit::Result<()> {
println!("{m:?}");
Expand All @@ -79,7 +79,7 @@ fn main() -> elicit::Result<()> {
Ok(())
})?;

let y = MineY::new(1);
let y = Y::new(1);
e = MineElicit::new(y)?;

e.try_with_mut(|m| -> elicit::Result<()> {
Expand Down
23 changes: 11 additions & 12 deletions examples/melicit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// @author hanepjiv <[email protected]>
// @copyright The MIT License (MIT) / Apache License Version 2.0
// @since 2024/04/13
// @date 2024/09/11
// @date 2024/12/01

// ////////////////////////////////////////////////////////////////////////////
// use =======================================================================
Expand All @@ -29,9 +29,9 @@ pub(crate) mod mine {
// ========================================================================
#[derive(Debug, Default, Clone, Melicit)]
#[melicit_mod_author(mine_melicit::author)]
pub struct MineX {}
pub struct X {}
// ------------------------------------------------------------------------
impl Mine for MineX {
impl Mine for X {
fn action(&self) -> i32 {
0i32
}
Expand All @@ -40,22 +40,22 @@ pub(crate) mod mine {
#[derive(Debug, Clone, Melicit)]
#[melicit_mod_author(mine_melicit::author)]
// #[melicit_from_self_field(_fsf)] here
pub struct MineY {
pub struct Y {
#[melicit_from_self_field] // or here
_fsf: mine_melicit::author::MelicitFromSelfField,
i: i32,
}
// ------------------------------------------------------------------------
impl MineY {
impl Y {
pub(crate) fn new(a: i32) -> Self {
Self {
_fsf: Default::default(),
_fsf: mine_melicit::author::MelicitFromSelfField::default(),
i: a,
}
}
}
// ------------------------------------------------------------------------
impl Mine for MineY {
impl Mine for Y {
fn action(&self) -> i32 {
self.i
}
Expand Down Expand Up @@ -127,8 +127,7 @@ mod error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match *self {
Error::Elicit(ref e) => Some(e),
Error::MelicitLock(_) => None,
Error::MelicitTryLock(_) => None,
Error::MelicitLock(_) | Error::MelicitTryLock(_) => None,
}
}
}
Expand All @@ -141,11 +140,11 @@ mod error {
// ============================================================================
fn main() -> elicit::Result<()> {
use mine::melicit_user::Melicit as MineMelicit;
use mine::{MineX, MineY};
use mine::{X, Y};

let mut e: MineMelicit;

e = MineMelicit::new(MineX::default())?;
e = MineMelicit::new(X::default())?;

if let Err(x) = e.with(|m| -> error::Result<'_, ()> {
println!("{m:?}");
Expand All @@ -155,7 +154,7 @@ fn main() -> elicit::Result<()> {
eprintln!("{x:?}");
}

let y = MineY::new(3);
let y = Y::new(3);
e = MineMelicit::new(y)?;

if let Err(x) = e.try_with(|m| -> error::Result<'_, ()> {
Expand Down

0 comments on commit 7d0fcc9

Please sign in to comment.