Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
appaquet committed Feb 23, 2024
1 parent 3b853e1 commit 30d2d75
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@
//! struct MyStruct(u32);
//!
//! impl Sortable for MyStruct {
//! fn encode<W: Write>(&self, write: &mut W) {
//! write.write_u32::<byteorder::LittleEndian>(self.0).unwrap();
//! fn encode<W: Write>(&self, write: &mut W) -> std::io::Result<()> {
//! write.write_u32::<byteorder::LittleEndian>(self.0)?;
//! Ok(())
//! }
//!
//! fn decode<R: Read>(read: &mut R) -> Option<MyStruct> {
//! fn decode<R: Read>(read: &mut R) -> std::io::Result<MyStruct> {
//! read.read_u32::<byteorder::LittleEndian>()
//! .ok()
//! .map(MyStruct)
//! }
//! }
//!
//! let sorter = ExternalSorter::new();
//! let reversed_data = (0..1000).rev().map(MyStruct).into_iter();
//! let sorted_iter = sorter.sort(reversed_data).unwrap();
//! let sorted_data: Vec<MyStruct> = sorted_iter.collect();
//! let sorted_data = sorted_iter.collect::<std::io::Result<Vec<MyStruct>>>().unwrap();
//!
//! let expected_data = (0..1000).map(MyStruct).collect::<Vec<MyStruct>>();
//! assert_eq!(sorted_data, expected_data);
Expand Down

0 comments on commit 30d2d75

Please sign in to comment.