Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub struct ClickTargetsLL {
- pub target: ClickTarget,
- pub next: Option<Box<ClickTargetsLL>>,
- }
- pub enum ClickTarget {
- Gameboard,
- SaliencyMaps,
- RewardBars,
- }
- pub struct ClickTargets {
- pub targets: Vec<ClickTarget>,
- }
- impl From<ClickTargetsLL> for ClickTargets {
- fn from(tar: ClickTargetsLL) -> Self {
- let mut targets = Vec::new();
- targets.push(tar.target);
- let mut next = tar.next;
- while let Some(t) = next {
- next = {
- let tt = *t;
- let ClickTargetsLL {
- target,
- next,
- } = tt;
- targets.push(target);
- next
- };
- }
- ClickTargets { targets }
- }
- }
- fn main() {}
Add Comment
Please, Sign In to add comment