From 7836fa5ff4de22858d2aa52bb7c4f025c4798835 Mon Sep 17 00:00:00 2001 From: Mark Morley Date: Wed, 26 Jun 2024 14:40:45 -0400 Subject: [PATCH] docs: fixes #436 Xlsx WorksheetNotFound error is simply propogated rather than using ok or --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4bfc9aa..68f7421 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ use calamine::{open_workbook, Error, Xlsx, Reader, RangeDeserializerBuilder}; fn example() -> Result<(), Error> { let path = format!("{}/tests/temperature.xlsx", env!("CARGO_MANIFEST_DIR")); let mut workbook: Xlsx<_> = open_workbook(path)?; - let range = workbook.worksheet_range("Sheet1") - .ok_or(Error::Msg("Cannot find 'Sheet1'"))??; + let range = workbook.worksheet_range("Sheet1")?; + let mut iter = RangeDeserializerBuilder::new().from_range(&range)?;