Skip to content

Commit 78e2a56

Browse files
docs: fix non-compiling README example and From/TryFrom mix-up
MsDosDateTime::new returns Option<Self> since 9cd9520, but the README quick start was not updated and no longer compiled; it was also missing the error type annotation on the content stream that type inference needs. Align it with the compile-tested lib.rs doctest. The jiff feature provides TryFrom<jiff::civil::DateTime>, not From, in both the README feature table and the crate-level docs.
1 parent 1b205bf commit 78e2a56

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ use tokio::{fs::File, io::AsyncWriteExt};
2020

2121
#[tokio::main(flavor = "current_thread")]
2222
async fn main() -> io::Result<()> {
23-
let modified = MsDosDateTime::new(2026, 3, 10, 12, 30, 0);
23+
let modified = MsDosDateTime::new(2026, 3, 10, 12, 30, 0).unwrap();
2424

2525
let entries = stream::iter([
2626
Ok(ZipEntry::File {
2727
path: "hello.txt".into(),
2828
modified,
29-
content: stream::iter([Ok(Bytes::from_static(b"Hello, world!"))]),
29+
content: stream::iter([Ok::<_, io::Error>(Bytes::from_static(b"Hello, world!"))]),
3030
}),
3131
Ok(ZipEntry::Directory {
3232
path: "subdir/".into(),
@@ -60,7 +60,7 @@ async fn main() -> io::Result<()> {
6060
| Feature | Default | Description |
6161
|---------|---------|-------------|
6262
| `std` | Yes | Enables runtime SIMD detection for faster CRC-32. Everything works without it. |
63-
| `jiff` | No | Adds `From<jiff::civil::DateTime>` for `MsDosDateTime`. |
63+
| `jiff` | No | Adds `TryFrom<jiff::civil::DateTime>` for `MsDosDateTime`. |
6464

6565
## License
6666

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
//! # Features
6161
//!
6262
//! - **`std`** *(default)* - enables runtime SIMD detection for faster CRC-32.
63-
//! - **`jiff`** - adds `From<jiff::civil::DateTime>` for [`MsDosDateTime`].
63+
//! - **`jiff`** - adds `TryFrom<jiff::civil::DateTime>` for [`MsDosDateTime`].
6464
6565
#![cfg_attr(not(feature = "std"), no_std)]
6666

0 commit comments

Comments
 (0)