From 42a6e4b84488f3ab1011f2b534a7b9ea6d73e7fb Mon Sep 17 00:00:00 2001 From: Thomas Hurst Date: Sun, 22 Apr 2018 18:28:30 +0100 Subject: [PATCH] Add Travis build status to README. Tweak the example while I'm here. --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 570b5c2..92d5733 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -LineReader ----------- +# LineReader [![Build Status](https://travis-ci.org/Freaky/rust-linereader.svg?branch=master)](https://travis-ci.org/Freaky/rust-linereader) A fast line-oriented reader for Rust. ## Summary @@ -13,7 +12,8 @@ raw u8's, including the delimiter, and nothing more. Lines are limited to the size of the internal buffer (default 1MB). -No crate or anything yet - I want a test suite first. + extern crate linereader; + use linereader::LineReader; // Note BufReader will result in unnecessary copying, so, er, don't do that. let mut file = File::open(myfile).expect("open"); @@ -24,7 +24,8 @@ No crate or anything yet - I want a test suite first. let reader = LineReader::new(file); while let Some(line) = reader.next_line() { - line.expect("oh noes, an IO error"); + let line = line.expect("oh noes, an IO error"); + // line is a &[u8] owned by reader. } ## Performance