From e95c8315220fa7c0bf4e69d918f0ccc7cd54ab6e Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Thu, 16 Jan 2025 12:36:05 +0000 Subject: [PATCH] Relax bound on DataBufRead for Cursor This bound is overly restrictive - the point of Cursor is to provide a Read implementation for any byte buffer. Thus, it doesn't make sense to require that buffer itself also implements Read, as it prevents usage of Cursor with types like Vec, Rc<[u8]>, memmap2::Map and others. --- src/hdu/data/asciitable.rs | 2 +- src/hdu/data/bintable.rs | 2 +- src/hdu/data/image.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hdu/data/asciitable.rs b/src/hdu/data/asciitable.rs index c836584..66123ec 100644 --- a/src/hdu/data/asciitable.rs +++ b/src/hdu/data/asciitable.rs @@ -13,7 +13,7 @@ use crate::hdu::header::extension::Xtension; impl<'a, R> DataBufRead<'a, AsciiTable> for Cursor where - R: AsRef<[u8]> + Debug + Read + 'a, + R: AsRef<[u8]> + Debug + 'a, { type Data = Data<'a>; diff --git a/src/hdu/data/bintable.rs b/src/hdu/data/bintable.rs index 1dfba5d..ef8d9fd 100644 --- a/src/hdu/data/bintable.rs +++ b/src/hdu/data/bintable.rs @@ -15,7 +15,7 @@ use crate::hdu::header::extension::Xtension; impl<'a, R> DataBufRead<'a, BinTable> for Cursor where - R: AsRef<[u8]> + Debug + Read + 'a, + R: AsRef<[u8]> + Debug + 'a, { type Data = Data<'a>; diff --git a/src/hdu/data/image.rs b/src/hdu/data/image.rs index bc4950d..a0ee317 100644 --- a/src/hdu/data/image.rs +++ b/src/hdu/data/image.rs @@ -16,7 +16,7 @@ use crate::hdu::DataBufRead; impl<'a, R> DataBufRead<'a, Image> for Cursor where - R: AsRef<[u8]> + Debug + Read + 'a, + R: AsRef<[u8]> + Debug + 'a, { type Data = Data<'a>;