Skip to content

Commit

Permalink
Use set_mode()
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens committed Sep 27, 2024
1 parent 92308d2 commit 710824c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/readable/byob_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ pub struct ReadableStreamBYOBReader<'stream> {

impl<'stream> ReadableStreamBYOBReader<'stream> {
pub(crate) fn new(stream: &mut ReadableStream) -> Result<Self, js_sys::Error> {
let reader_options = sys::ReadableStreamGetReaderOptions::new();
reader_options.set_mode(sys::ReadableStreamReaderMode::Byob);
Ok(Self {
raw: stream
.as_raw()
.unchecked_ref::<sys::ReadableStreamExt>()
.try_get_reader_with_options(
sys::ReadableStreamGetReaderOptions::new()
.mode(sys::ReadableStreamReaderMode::Byob),
)?
.try_get_reader_with_options(&reader_options)?
.unchecked_into(),
_stream: PhantomData,
})
Expand Down

0 comments on commit 710824c

Please sign in to comment.