peepmatic: rustfmt
This commit is contained in:
@@ -155,27 +155,52 @@ where
|
|||||||
&self,
|
&self,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
None => return Err(de::Error::invalid_length(0, &"Automaton expects 5 elements")),
|
None => {
|
||||||
|
return Err(de::Error::invalid_length(
|
||||||
|
0,
|
||||||
|
&"Automaton expects 5 elements",
|
||||||
|
))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let final_states = match seq.next_element::<BTreeMap<State, TOutput>>()? {
|
let final_states = match seq.next_element::<BTreeMap<State, TOutput>>()? {
|
||||||
Some(x) => x,
|
Some(x) => x,
|
||||||
None => return Err(de::Error::invalid_length(1, &"Automaton expects 5 elements")),
|
None => {
|
||||||
|
return Err(de::Error::invalid_length(
|
||||||
|
1,
|
||||||
|
&"Automaton expects 5 elements",
|
||||||
|
))
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let start_state = match seq.next_element::<State>()? {
|
let start_state = match seq.next_element::<State>()? {
|
||||||
Some(x) => x,
|
Some(x) => x,
|
||||||
None => return Err(de::Error::invalid_length(2, &"Automaton expects 5 elements")),
|
None => {
|
||||||
|
return Err(de::Error::invalid_length(
|
||||||
|
2,
|
||||||
|
&"Automaton expects 5 elements",
|
||||||
|
))
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let state_data = match seq.next_element::<Vec<Option<TState>>>()? {
|
let state_data = match seq.next_element::<Vec<Option<TState>>>()? {
|
||||||
Some(x) => x,
|
Some(x) => x,
|
||||||
None => return Err(de::Error::invalid_length(3, &"Automaton expects 5 elements")),
|
None => {
|
||||||
|
return Err(de::Error::invalid_length(
|
||||||
|
3,
|
||||||
|
&"Automaton expects 5 elements",
|
||||||
|
))
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let transitions = match seq.next_element::<Vec<BTreeMap<TAlphabet, (State, TOutput)>>>()? {
|
let transitions = match seq.next_element::<Vec<BTreeMap<TAlphabet, (State, TOutput)>>>()? {
|
||||||
Some(x) => x,
|
Some(x) => x,
|
||||||
None => return Err(de::Error::invalid_length(4, &"Automaton expects 5 elements")),
|
None => {
|
||||||
|
return Err(de::Error::invalid_length(
|
||||||
|
4,
|
||||||
|
&"Automaton expects 5 elements",
|
||||||
|
))
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let automata = Automaton {
|
let automata = Automaton {
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ pub fn derive_span(input: &DeriveInput) -> Result<impl quote::ToTokens> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
syn::Data::Union(_) => panic!("derive(Ast) can only be used with structs and enums, not unions"),
|
syn::Data::Union(_) => {
|
||||||
|
panic!("derive(Ast) can only be used with structs and enums, not unions")
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let generics = add_span_trait_bounds(input.generics.clone());
|
let generics = add_span_trait_bounds(input.generics.clone());
|
||||||
|
|||||||
Reference in New Issue
Block a user