Skip to content

Commit aa92f23

Browse files
committed
doc tweak
1 parent 2f7bf36 commit aa92f23

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "shardio"
3-
version = "0.5.3"
3+
version = "0.5.4"
44
authors = ["Patrick Marks <patrick@10xgenomics.com>", "Sreenath Krishnan <sreenath.krishnan@10xgenomics.com>", "Lance Hepler <lance.hepler@10xgenomics.com>"]
55
edition = "2018"
66
license = "MIT"

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
//! sender.send(DataStruct { a: (i%25) as u64, b: (i%100) as u32 });
4242
//! }
4343
//!
44+
//! // done sending items
45+
//! sender.finished();
46+
//!
4447
//! // Write errors are accessible by calling the finish() method
4548
//! writer.finish()?;
4649
//! }
@@ -302,7 +305,8 @@ where
302305
/// flush remaining items to disk, write an index of the chunk data and close the file.
303306
///
304307
/// The `get_sender()` methods returns a `ShardSender` that must be used to send items to the writer.
305-
/// You must close each ShardSender by calling its `finish()` method, or data may be lost.
308+
/// You must close each ShardSender by dropping it or calling its `finish()` method, or data may be lost.
309+
/// The `ShardSender` must be dropped/finished prior to callinng `SharWriter::finish` or dropping the shard writer.
306310
///
307311
/// # Sorting
308312
/// Items are sorted according to the `Ord` implementation of type `S::Key`. Type `S`, implementing the `SortKey` trait
@@ -692,7 +696,8 @@ impl<T: Send> ShardSender<T> {
692696
}
693697

694698
/// Signal that you've finished sending items to this `ShardSender`. `finished` will called
695-
/// if the `ShardSender` is dropped.
699+
/// if the `ShardSender` is dropped. You must call `finished()` or drop the `ShardSender`
700+
/// prior to calling `ShardWriter::finish` or dropping the ShardWriter, or you will get a panic.
696701
pub fn finished(&mut self) {
697702
if !self.buffer.is_empty() {
698703
let mut send_buf = Vec::new();

0 commit comments

Comments
 (0)