Skip to content

Commit

Permalink
Fix missing dyn in bf-interpreter example
Browse files Browse the repository at this point in the history
  • Loading branch information
CensoredUsername committed Aug 23, 2019
1 parent 7047dfa commit e9e2ab2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/examples/bf-interpreter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ use std::fs::File;
const TAPE_SIZE: usize = 30000;

struct Interpreter<'a> {
pub input: Box<BufRead + 'a>,
pub output: Box<Write + 'a>,
pub input: Box<dyn BufRead + 'a>,
pub output: Box<dyn Write + 'a>,
pub loops: Vec<usize>,
pub tape: [u8; TAPE_SIZE],
pub tape_index: usize,
pub pos: usize
}

impl<'a> Interpreter<'a> {
fn new(input: Box<BufRead + 'a>, output: Box<Write + 'a>) -> Interpreter<'a> {
fn new(input: Box<dyn BufRead + 'a>, output: Box<dyn Write + 'a>) -> Interpreter<'a> {
Interpreter {
input: input,
output: output,
Expand Down

0 comments on commit e9e2ab2

Please sign in to comment.