From 604d4bc28acbdca12e300419a7b3d2778ae1b2e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jihyeon=20Kim=20=28=EA=B9=80=EC=A7=80=ED=98=84=29?= Date: Tue, 22 Oct 2024 18:32:57 +0900 Subject: [PATCH 1/2] README.md: (misc) Fix example Xlsx::worksheet_range() returns Result not Option> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 530eed5..28c8e03 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ function. use calamine::{Reader, Xlsx, open_workbook}; let mut excel: Xlsx<_> = open_workbook("file.xlsx").unwrap(); -if let Some(Ok(r)) = excel.worksheet_range("Sheet1") { +if let Ok(r) = excel.worksheet_range("Sheet1") { for row in r.rows() { println!("row={:?}, row[0]={:?}", row, row[0]); } From c79e8a4d7cd493a19ba2f0c774d7a2ee7692a280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jihyeon=20Kim=20=28=EA=B9=80=EC=A7=80=ED=98=84=29?= Date: Tue, 22 Oct 2024 22:08:39 +0900 Subject: [PATCH 2/2] README.md: Fix example code --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 28c8e03..c757613 100644 --- a/README.md +++ b/README.md @@ -106,12 +106,12 @@ if let Ok(r) = excel.worksheet_range("Sheet1") { ### Reader: With header row ```rs -use calamine::{Reader, Xlsx, open_workbook}; +use calamine::{HeaderRow, Reader, Xlsx, open_workbook}; let mut excel: Xlsx<_> = open_workbook("file.xlsx").unwrap(); let sheet1 = excel - .with_header_row(Some(3)) + .with_header_row(HeaderRow::Row(3)) .worksheet_range("Sheet1") .unwrap(); ```