Skip to content

Commit 9646a0c

Browse files
committed
Update code examples and bump minor
1 parent 6c4943b commit 9646a0c

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
# [Unreleased]
88

9+
## 0.2.0 - 2020-10-10
910

10-
# [0.1.0] - 2020-10-08
11+
### Changed
1112

12-
## Added
13+
- Reader takes a reference to the schema.
14+
15+
## 0.1.0 - 2020-10-08
16+
17+
### Added
1318

1419
Initial implementation of
1520
- avrow

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Add avrow as a dependency to `Cargo.toml`:
8181

8282
```toml
8383
[dependencies]
84-
avrow = "0.1.0"
84+
avrow = "0.2.0"
8585
```
8686

8787
## Examples:
@@ -129,7 +129,7 @@ fn main() -> Result<(), Error> {
129129
183, 148, 48, 236, 212, 250, 38, 208,
130130
];
131131
// Create a Reader
132-
let reader = Reader::with_schema(v.as_slice(), schema)?;
132+
let reader = Reader::with_schema(v.as_slice(), &schema)?;
133133
for i in reader {
134134
dbg!(&i);
135135
}
@@ -191,7 +191,7 @@ fn main() -> Result<(), Error> {
191191
let buf = writer.into_inner()?;
192192

193193
// read
194-
let reader = Reader::with_schema(buf.as_slice(), schema)?;
194+
let reader = Reader::with_schema(buf.as_slice(), &schema)?;
195195
for i in reader {
196196
let a: LongList = from_value(&i)?;
197197
dbg!(a);
@@ -271,7 +271,7 @@ fn main() -> Result<(), Error> {
271271
writer.write(rec)?;
272272

273273
let avro_data = writer.into_inner()?;
274-
let reader = crate::Reader::from(avro_data.as_slice())?;
274+
let reader = crate::Reader::new(avro_data.as_slice())?;
275275
for value in reader {
276276
let mentors: RustMentors = from_value(&value)?;
277277
dbg!(mentors);

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
//! Avrow is a pure Rust implementation of the [Apache Avro specification](https://avro.apache.org/docs/current/spec.html).
22
//!
3-
//! For more details on the spec, head over to [FAQ](https://cwiki.apache.org/confluence/display/AVRO/FAQ)
3+
//! Pleaes refer to the [README](https://github.com/creativcoder/avrow/blob/main/README.md) for an overview.
4+
//! For more details on the spec, head over to the [FAQ](https://cwiki.apache.org/confluence/display/AVRO/FAQ).
45
//!
56
//! ## Using the library
67
//!
78
//! Add to your `Cargo.toml`:
89
//!```toml
910
//! [dependencies]
10-
//! avrow = "0.1"
11+
//! avrow = "0.2.0"
1112
//!```
1213
//! ### A hello world example of reading and writing avro data files
1314

src/reader.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ where
3838
R: Read,
3939
{
4040
/// Creates a Reader from an avro encoded readable buffer.
41-
pub fn new(mut avro_source: R) -> Result<Self, AvrowErr> {
42-
let header = Header::from_reader(&mut avro_source)?;
41+
pub fn new(mut source: R) -> Result<Self, AvrowErr> {
42+
let header = Header::from_reader(&mut source)?;
4343
Ok(Reader {
44-
source: avro_source,
44+
source,
4545
header,
4646
reader_schema: None,
4747
block_buffer: Cursor::new(vec![0u8; DEFAULT_FLUSH_INTERVAL]),

0 commit comments

Comments
 (0)