Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README is incorrect about what the sample code prints #74

Open
tekknolagi opened this issue Jun 12, 2019 · 1 comment
Open

README is incorrect about what the sample code prints #74

tekknolagi opened this issue Jun 12, 2019 · 1 comment

Comments

@tekknolagi
Copy link

Bug Report

Your Environment

Software Version(s)
hypercore 0.9.0
Rustc rustc 1.35.0-nightly (237bf3244 2019-03-28)
Operating System Ubuntu 18.04

Expected Behavior

Program prints

hello
world

Current Behavior

Program prints

Ok(Some([104, 101, 108, 108, 111]))
Ok(Some([119, 111, 114, 108, 100]))

Code Sample

extern crate hypercore;

use hypercore::Feed;
use std::path::PathBuf;

let path = PathBuf::from("./my-first-dataset");
let mut feed = Feed::new(&path).unwrap();

feed.append(b"hello").unwrap();
feed.append(b"world").unwrap();

println!("{:?}", feed.get(0)); // prints "hello"
println!("{:?}", feed.get(1)); // prints "world"
@yoshuawuyts
Copy link
Contributor

Oh yeah, it should be an assertion instead:

assert_eq!(feed.get(0)?, Some(b"hello"));
assert_eq!(feed.get(1)?, Some(b"world"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants