stickeritis / sticker

Succeeded by SyntaxDot: https://github.com/tensordot/syntaxdot
Other
25 stars 2 forks source link

Shuffled: factor out Vec with random draws #160

Closed danieldk closed 5 years ago

danieldk commented 5 years ago
danieldk commented 5 years ago

Looks good.

This already included the new item, right?

let sent = match self.inner.next() {
            Some(sent) => {
                match sent {
                    Ok(sent) => self.buffer.push(sent),
                    Err(err) => return Some(Err(err)),
                }
                let buffer_len = self.buffer.len();
                self.buffer.swap_remove(self.rng.gen_range(0, buffer_len))
            }

You are right, I'll update the commit message!