Skip to content

Commit

Permalink
chore: minor state machine es clean up items (#5654)
Browse files Browse the repository at this point in the history
* full word

* remove stale comment

* chore: remove unused IntoResult
  • Loading branch information
kylezs authored Feb 19, 2025
1 parent f07886b commit cf5f1cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ use sp_std::fmt::Debug;
/// `input_index`, an election with these election properties is going to be created automatically.
///
/// ## Idle results
/// When there is no consensus, the electoral system still has to return sth in its `on_finalize`
/// function. This value is provided by the `get(&State) -> DisplayState` function. The associated
/// `DisplayState` type is an arbitrary "summary" of the current state, meant for consumers of the
/// `on_finalize` result.
/// When there is no consensus, the electoral system still has to return something in its
/// `on_finalize` function. This value is provided by the `get(&State) -> DisplayState` function.
/// The associated `DisplayState` type is an arbitrary "summary" of the current state, meant for
/// consumers of the `on_finalize` result.
///
/// Note: it might be that this functionality is going to be modelled differently in the future.
///
Expand All @@ -54,7 +54,6 @@ pub trait StateMachine: 'static {
type Settings;
type Output: Validate;
type State: Validate;
// type DisplayState;

/// To every state, this function associates a set of input indices which
/// describes what kind of input(s) we want to receive next.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,6 @@ use super::{
state_machine::StateMachine,
};

pub trait IntoResult {
type Ok;
type Err;

fn into_result(self) -> Result<Self::Ok, Self::Err>;
}

impl<A, B> IntoResult for Result<A, B> {
type Ok = A;
type Err = B;
fn into_result(self) -> Result<A, B> {
self
}
}

/// This is an Either type, unfortunately it's more ergonomic
/// to recreate this instead of using `itertools::Either`, because
/// we need a special implementation of Indexed: we want the vote to
Expand Down

0 comments on commit cf5f1cb

Please sign in to comment.