小编Win*_*r C的帖子

`flat_map`如何影响我的代码?

我一整天都在研究以下代码,(是围栏)

/// The rule that moves state from one to another.
///
/// `S` - the type parameter of state.
///
/// `T` - the type parameter of input symbol.
#[deriving(PartialEq, Eq, Hash)]
pub struct Rule<S, T> {
  pub state: S,
  pub symbol: Option<T>,
  pub next_state: S
}

impl<S: PartialEq, T: PartialEq> Rule<S, T> {
  /// determine whether the rule applies to the given state and symbol
  pub fn apply_to(&self, state: &S, symbol: &Option<T>) -> bool {
    self.state …
Run Code Online (Sandbox Code Playgroud)

rust

6
推荐指数
1
解决办法
2526
查看次数

标签 统计

rust ×1