Skip to content

Commit 495e8db

Browse files
committed
Added comments
1 parent e82b88e commit 495e8db

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/bin/multi_write.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ impl<T> FnMove<T> {
4545
fn call(&self, buf: &mut Vec<u8>, t: T, a: u64) -> Result<(), String> {
4646
(self.f)(buf, t, a)
4747
}
48-
}
48+
}
49+
4950
unsafe impl<T> Send for FnMove<T> {}
5051
unsafe impl<T> Sync for FnMove<T> {}
5152

@@ -119,11 +120,20 @@ fn main() {
119120
std::fs::remove_file(&filename).expect("Cannot delete file");
120121
}
121122

122-
// |||..........|.....||..........|.....||... ||...|.|||
123-
// <---1----><--2-> <3><4>
124-
// . <-------5------> <--6->
125-
// <---------------------- 7 -------------------->
126-
123+
/// Write data to file.
124+
/// ```no_run
125+
/// |||..........|.....||..........|.....||...>> ||...|.|||
126+
/// <---1----><--2-> <3><4>
127+
/// <-------5------> <--6->
128+
/// <-------------------------7---------------------->
129+
/// ```
130+
/// 1. task_chunk_size
131+
/// 2. last_task_chunk_size
132+
/// 3. last_producer_task_chunk_size
133+
/// 4. last_producer_last_task_chunk_size
134+
/// 5. producer_chunk_size
135+
/// 6. last_producer_chunk_size
136+
/// 7. total_size
127137
// -----------------------------------------------------------------------------
128138
fn write_to_file<T: 'static + Clone + Send + Sync>(
129139
filename: &str,

0 commit comments

Comments
 (0)