commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
63c7d2eed3f6b86048104a3faaf7d37bd6685303 | Michael-F-Bryan | 2017-06-07T23:39:24 | Bumping version number so I don't forget later | diff --git a/Cargo.toml b/Cargo.toml
index 6850b9d..ca890b6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
authors = ["Michael-F-Bryan <michaelfbryan@gmail.com>"]
name = "include_dir"
-version = "0.1.2"
+version = "0.1.3"
description = "The logical evolution of the include_str macro for embeddin... | 1 | 1 | 1 |
54477d24a2221fcb199ad9c490287ff25197f8a1 | Michael-F-Bryan | 2017-06-07T23:33:03 | Bumping the version number to release the walk and find features | diff --git a/Cargo.toml b/Cargo.toml
index f7a697a..6850b9d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
authors = ["Michael-F-Bryan <michaelfbryan@gmail.com>"]
name = "include_dir"
-version = "0.1.1"
+version = "0.1.2"
description = "The logical evolution of the include_str macro for embeddin... | 1 | 1 | 1 |
3d7d3afd77c888668b15b7d3c647f3d161e12bd0 | Michael-F-Bryan | 2017-06-07T20:24:47 | You can now walk a directory | diff --git a/integration_tests/walk.rs b/integration_tests/walk.rs
index c9b5703..a2b0da2 100644
--- a/integration_tests/walk.rs
+++ b/integration_tests/walk.rs
@@ -6,7 +6,12 @@ fn main() {
let mut number_of_dirs = 0;
for entry in ASSETS.walk() {
- println!("{}", entry.name);
+ println!("{}", ... | 2 | 35 | 1 |
6584d9521ddde987d5c2cfba20809739009baadc | Michael-F-Bryan | 2017-06-07T20:18:00 | Added the initial Dir::walk() test | diff --git a/integration_tests/walk.rs b/integration_tests/walk.rs
new file mode 100644
index 0000000..c9b5703
--- /dev/null
+++ b/integration_tests/walk.rs
@@ -0,0 +1,15 @@
+use assets::ASSETS;
+use assets::DirEntry;
+
+fn main() {
+ let mut number_of_files = 0;
+ let mut number_of_dirs = 0;
+
+ for entry in ... | 3 | 81 | 9 |
9b8882ab075c364154c80c0bbdb0e17dde6be5d4 | Michael-F-Bryan | 2017-06-07T19:01:27 | Fixed up the badges in Cargo.toml (dodgy links) | diff --git a/Cargo.toml b/Cargo.toml
index 3c3ea5d..f7a697a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
authors = ["Michael-F-Bryan <michaelfbryan@gmail.com>"]
name = "include_dir"
-version = "0.1.0"
+version = "0.1.1"
description = "The logical evolution of the include_str macro for embeddin... | 1 | 3 | 3 |
62b2a6619c29f4e54010ce12033ebf0da5b82cac | Michael-F-Bryan | 2017-06-07T18:58:45 | Removed walkdir as a dependency | diff --git a/Cargo.toml b/Cargo.toml
index 76e9463..3c3ea5d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,7 +16,6 @@ appveyor = { repository = "https://github.com/Michael-F-Bryan/include_dir", bran
[dependencies]
error-chain = "0.10.0"
-walkdir = "1.0.7"
[dev-dependencies]
tempdir = "0.3.5"
diff --git a/src/l... | 2 | 0 | 2 |
bb6d8e72df38756be450932626ce233bccece754 | Michael-F-Bryan | 2017-06-07T17:19:03 | Reduced the API surface and fixed Cargo.toml whitespacing | diff --git a/Cargo.toml b/Cargo.toml
index a82c167..76e9463 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,11 +10,8 @@ categories = ["development-tools", "web-programming", "game-engines"]
keywords = ["include", "embed", "assets"]
[badges]
-travis-ci = { repository = "https://github.com/Michael-F-Bryan/include_dir... | 3 | 5 | 10 |
1ca371440c58df2b75a6b11912b35cae4b4a7b64 | Michael-F-Bryan | 2017-06-07T15:16:44 | Made clippy happy | diff --git a/src/frontend.rs b/src/frontend.rs
index 6453373..8cecd1d 100644
--- a/src/frontend.rs
+++ b/src/frontend.rs
@@ -1,3 +1,5 @@
+#![cfg_attr(feature = "cargo-clippy", allow(wrong_self_convention))]
+
use std::path::Path;
use std::fs::File;
@@ -11,7 +13,7 @@ use errors::*;
/// # Note
///
/// It is pretty... | 2 | 14 | 23 |
8e90d22070ba65f4ee9439a40b72410c3f88fffd | Michael-F-Bryan | 2017-06-07T15:10:36 | Updated the crate docs with copy/paste-able examples | diff --git a/src/lib.rs b/src/lib.rs
index f9f8f6c..ce18ef7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,5 +1,32 @@
//! The logical evolution of the `include_str!()` macro to allow embedding
//! entire file trees.
+//!
+//! If you want to use this in stable, you'll need a `build.rs` build script.
+//!
+//! ```rust,... | 1 | 27 | 0 |
fac6b55946e7646c93201c9f06e56fe3c6b733dd | Michael-F-Bryan | 2017-06-07T15:05:22 | Fixed up some of the bugs and it now compiles | diff --git a/src/frontend.rs b/src/frontend.rs
index ee7ed3b..6453373 100644
--- a/src/frontend.rs
+++ b/src/frontend.rs
@@ -26,7 +26,7 @@ pub struct IncludeDirBuilder {
///
/// # Examples
///
-/// ```rust
+/// ```rust,no_run
/// use std::env;
/// use std::path::Path;
/// use include_dir::include_dir;
@@ -34,7 +3... | 3 | 12 | 11 |
4c11dcde144193fc9b6903eb68e2b7e3163513d8 | Michael-F-Bryan | 2017-06-07T14:57:34 | Added a frontend convenience layer | diff --git a/src/frontend.rs b/src/frontend.rs
new file mode 100644
index 0000000..ee7ed3b
--- /dev/null
+++ b/src/frontend.rs
@@ -0,0 +1,96 @@
+use std::path::Path;
+use std::fs::File;
+
+use dirs::{self, Dir};
+use serializer::Serializer;
+use errors::*;
+
+
+/// A builder object to give the `include_dir()` function ... | 3 | 101 | 2 |
2a54b2329f84c6e5b426bd5bd89a3252499fc046 | Michael-F-Bryan | 2017-06-07T14:32:24 | Added some docs for Serializer | diff --git a/src/lib.rs b/src/lib.rs
index 0c95460..e00ca31 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -23,6 +23,7 @@ mod serializer;
pub use errors::*;
pub use files::File;
pub use dirs::{include_dir, Dir};
+pub use serializer::Serializer;
mod errors {
diff --git a/src/serializer.rs b/src/serializer.rs
index ... | 2 | 6 | 2 |
a065b59c55ee30634dbf83649e22d6807cbec4ab | Michael-F-Bryan | 2017-06-07T14:29:29 | Added a basic serializer... which seems to actually work! | diff --git a/src/lib.rs b/src/lib.rs
index dafc591..0c95460 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -18,6 +18,7 @@ extern crate tempdir;
mod files;
mod dirs;
+mod serializer;
pub use errors::*;
pub use files::File;
diff --git a/src/serializer.rs b/src/serializer.rs
new file mode 100644
index 0000000..03ad7c... | 2 | 219 | 0 |
50d195f03765c364d50e255836b0552a0b5f2134 | Michael-F-Bryan | 2017-06-07T12:56:51 | Added a bunch of docs | diff --git a/src/dirs.rs b/src/dirs.rs
index 34dc761..7e030bb 100644
--- a/src/dirs.rs
+++ b/src/dirs.rs
@@ -1,9 +1,10 @@
use std::path::{Path, PathBuf};
-use files::File;
+use files::{include_file, File};
use errors::*;
+/// Traverse a file tree, building up an in-memory representation of it.
pub fn include_d... | 3 | 41 | 27 |
0da15d0167b837bb23ef22806b6ca299273961ba | Michael-F-Bryan | 2017-06-07T12:51:31 | Removed a heap of crap and made clippy happy | diff --git a/src/dirs.rs b/src/dirs.rs
index e3a1c36..34dc761 100644
--- a/src/dirs.rs
+++ b/src/dirs.rs
@@ -1,5 +1,4 @@
use std::path::{Path, PathBuf};
-use std::io::Write;
use files::File;
use errors::*;
@@ -8,7 +7,7 @@ use errors::*;
pub fn include_dir<P: AsRef<Path>>(root: P) -> Result<Dir> {
let full_na... | 3 | 16 | 150 |
272dc26aa0d5c541bd024805da391b272a26576d | Michael-F-Bryan | 2017-06-07T12:39:54 | Fixed a typo | diff --git a/src/files.rs b/src/files.rs
index 81dc20b..4d51d7d 100644
--- a/src/files.rs
+++ b/src/files.rs
@@ -92,7 +92,7 @@ mod tests {
let should_be = format!(r#"File {{
name: "{}",
- contents: vec!{:?},
+ contents: &{:?},
}}
"#,
path.file_name().and_then(|s|... | 1 | 1 | 1 |
d351db10c4bd276ca3c709584e89f0213d458ae0 | Michael-F-Bryan | 2017-06-07T12:38:58 | Added an ignore for the failing tests | diff --git a/src/dirs.rs b/src/dirs.rs
index b0b3c77..e3a1c36 100644
--- a/src/dirs.rs
+++ b/src/dirs.rs
@@ -153,6 +153,7 @@ mod tests {
}
#[test]
+ #[ignore]
fn make_sure_dir_compiles() {
let mut temp = NamedTempFile::new().unwrap();
diff --git a/src/files.rs b/src/files.rs
index 443ff49... | 2 | 2 | 0 |
54ec79c4336144fe202651e48cd7fc774d8801ca | Michael-F-Bryan | 2017-06-07T12:38:23 | Added a compilation test for File | diff --git a/src/files.rs b/src/files.rs
index 12eb84e..443ff49 100644
--- a/src/files.rs
+++ b/src/files.rs
@@ -13,6 +13,10 @@ pub struct File {
impl File {
+ fn definition() -> &'static str {
+ "pub struct File { name: &'static str, contents: &'static [u8], }"
+ }
+
pub fn new<P: AsRef<Path>>(f... | 1 | 37 | 1 |
480649f6d4e0a684d5757e16019977a60234e8ec | Michael-F-Bryan | 2017-06-07T12:23:02 | Added a test to check if Dir's output compiles (it doesn't) | diff --git a/src/dirs.rs b/src/dirs.rs
index 790285d..b0b3c77 100644
--- a/src/dirs.rs
+++ b/src/dirs.rs
@@ -93,7 +93,8 @@ mod tests {
use tempfile::NamedTempFile;
use tempdir::TempDir;
use std::fs;
- use std::io::Write;
+ use std::io::{Read, Seek, SeekFrom, Write};
+ use std::process::{Command,... | 1 | 27 | 1 |
82959e17092d563f947bfb2f49e4ab67f663ede8 | Michael-F-Bryan | 2017-06-07T12:09:27 | Can now write the representation of a dir to a string | diff --git a/src/dirs.rs b/src/dirs.rs
index 4866ae1..790285d 100644
--- a/src/dirs.rs
+++ b/src/dirs.rs
@@ -1,4 +1,5 @@
use std::path::{Path, PathBuf};
+use std::io::Write;
use files::File;
use errors::*;
@@ -62,6 +63,27 @@ impl Dir {
subdirs: Vec::new(),
}
}
+
+ pub fn write_to<W: W... | 1 | 42 | 0 |
ac8e824dd7a80a34bfc6894202b5863ffd91f86d | Michael-F-Bryan | 2017-06-07T10:46:59 | Can recursively get all directories | diff --git a/src/dirs.rs b/src/dirs.rs
index 73fde7c..4866ae1 100644
--- a/src/dirs.rs
+++ b/src/dirs.rs
@@ -15,8 +15,9 @@ pub fn include_dir<P: AsRef<Path>>(root: P) -> Result<Dir> {
bail!("{} is not a directory", full_name.display());
}
- let subdirs = Vec::new();
+
let files = files_in_dir(&f... | 1 | 26 | 1 |
b619241f082c65b83e3c6ee896011a807a97fc22 | Michael-F-Bryan | 2017-06-07T10:40:22 | Can get all files in a directory | diff --git a/src/dirs.rs b/src/dirs.rs
index 52b692a..73fde7c 100644
--- a/src/dirs.rs
+++ b/src/dirs.rs
@@ -4,6 +4,38 @@ use files::File;
use errors::*;
+pub fn include_dir<P: AsRef<Path>>(root: P) -> Result<Dir> {
+ let full_name = PathBuf::from(root.as_ref());
+ let name = match full_name.file_name().and_... | 2 | 65 | 19 |
2551bbeb5ee4d12a7eb1a98cd88cbdccc1193e58 | Michael-F-Bryan | 2017-06-07T10:23:39 | Created an initial Dir | diff --git a/Cargo.toml b/Cargo.toml
index 13ef4f7..19a17cb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,4 +8,5 @@ error-chain = "0.10.0"
walkdir = "1.0.7"
[dev-dependencies]
+tempdir = "0.3.5"
tempfile = "2.1.5"
diff --git a/src/dirs.rs b/src/dirs.rs
new file mode 100644
index 0000000..52b692a
--- /dev/null
+++... | 4 | 72 | 1 |
e3472ea21a8732004cdd0d9ea2a720a522bd60ac | Michael-F-Bryan | 2017-06-07T10:11:22 | Updated the crate name | diff --git a/Cargo.toml b/Cargo.toml
index 32858fb..1a56120 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
authors = ["Michael-F-Bryan <michaelfbryan@gmail.com>"]
-name = "includedir"
+name = "include_dir"
version = "0.1.0"
[dependencies] | 1 | 1 | 1 |
69c9b9461941602d402f47650567299623879c4f | Michael-F-Bryan | 2017-06-07T10:07:21 | Able to write the static representation of a File to disk | diff --git a/Cargo.toml b/Cargo.toml
index b3fdefd..6583ef7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,3 +6,6 @@ version = "0.1.0"
[dependencies]
error-chain = "0.10.0"
walkdir = "1.0.7"
+
+[dev-dependencies]
+tempfile = "2.1.5"
diff --git a/src/files.rs b/src/files.rs
index ffa042f..809c563 100644
--- a/src/fil... | 3 | 52 | 12 |
6af08c39bc517936a5ae6ccce08a5b7216327866 | Michael-F-Bryan | 2017-06-07T09:42:01 | Created an initial `File` implementation and read from disk | diff --git a/Cargo.toml b/Cargo.toml
index 32858fb..b3fdefd 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,4 +4,5 @@ name = "includedir"
version = "0.1.0"
[dependencies]
+error-chain = "0.10.0"
walkdir = "1.0.7"
diff --git a/src/files.rs b/src/files.rs
new file mode 100644
index 0000000..ffa042f
--- /dev/null
+++ ... | 3 | 68 | 56 |
2034ef91cdb6cafeaf8a1bc7e2c285a1213e5425 | Mattias Buelens | 2026-02-08T21:04:43 | Update to Rust 2024 (#34) | diff --git a/Cargo.toml b/Cargo.toml
index 26f5e60..b704399 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,7 +2,7 @@
name = "wasm-streams"
version = "0.5.0"
authors = ["Mattias Buelens <mattias@buelens.com>"]
-edition = "2021"
+edition = "2024"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "http... | 19 | 47 | 54 |
7d0e886925dfb4ff4fa6aa2382b72873a285c46b | Guy Bedford | 2026-01-20T16:06:23 | fix: persist stream error state (#27) | diff --git a/src/writable/into_sink.rs b/src/writable/into_sink.rs
index 8e285c5..ad4d343 100644
--- a/src/writable/into_sink.rs
+++ b/src/writable/into_sink.rs
@@ -19,6 +19,8 @@ use super::WritableStreamDefaultWriter;
#[derive(Debug)]
pub struct IntoSink<'writer> {
writer: Option<WritableStreamDefaultWriter<'wr... | 4 | 98 | 11 |
8be760732d26d4cf6c2f694f27509654a5f14d1e | Guy Bedford | 2026-01-20T10:08:47 | fix: lifetime elision warnings (#29) | diff --git a/src/readable/byob_reader.rs b/src/readable/byob_reader.rs
index bb722b4..d67a7c0 100644
--- a/src/readable/byob_reader.rs
+++ b/src/readable/byob_reader.rs
@@ -77,9 +77,9 @@ impl<'stream> ReadableStreamBYOBReader<'stream> {
/// the result before copying to `dst`. We cannot pass a view on the backing W... | 4 | 9 | 9 |
593bdb60fe9c96ceb17144fa62600b6cf3240763 | Mattias Buelens | 2024-10-25T12:45:28 | Simplify | diff --git a/src/writable/into_underlying_sink.rs b/src/writable/into_underlying_sink.rs
index eb472f2..1d35372 100644
--- a/src/writable/into_underlying_sink.rs
+++ b/src/writable/into_underlying_sink.rs
@@ -74,10 +74,7 @@ impl Inner {
}
async fn close(&mut self) -> Result<(), JsValue> {
- let sink ... | 1 | 1 | 4 |
acee0033d406c88b2d3a1399e448d022afba790a | Mattias Buelens | 2024-10-25T09:35:53 | Update dependencies | diff --git a/Cargo.toml b/Cargo.toml
index 8c08a4e..6776a4c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,13 +17,13 @@ exclude = [
crate-type = ["cdylib", "rlib"]
[dependencies]
-js-sys = "^0.3.70"
-wasm-bindgen = "0.2.93"
-wasm-bindgen-futures = "^0.4.43"
-futures-util = { version = "^0.3.30", features = ["io", ... | 1 | 8 | 8 |
257377598acff13014cff402dfcf5d676e4f0c37 | Mattias Buelens | 2024-09-27T23:24:03 | Fix Clippy issues | diff --git a/tests/tests/readable_byte_stream.rs b/tests/tests/readable_byte_stream.rs
index 4fa330d..6fe1a5e 100644
--- a/tests/tests/readable_byte_stream.rs
+++ b/tests/tests/readable_byte_stream.rs
@@ -48,11 +48,8 @@ async fn test_readable_byte_stream_read_with_buffer() {
let mut reader = readable.get_byob_re... | 4 | 17 | 11 |
7556f73df4248dc981cc928c20bb3894f4559461 | Mattias Buelens | 2024-09-27T23:19:45 | cargo fmt | diff --git a/src/readable/mod.rs b/src/readable/mod.rs
index 76e3b01..05cdb50 100644
--- a/src/readable/mod.rs
+++ b/src/readable/mod.rs
@@ -71,8 +71,9 @@ impl ReadableStream {
// Set HWM to 0 to prevent the JS ReadableStream from buffering chunks in its queue,
// since the original Rust stream is bet... | 2 | 4 | 3 |
9eee67d69d5ffbd7ab9ce523637ef149f7b9aa1a | Mattias Buelens | 2024-09-27T23:13:08 | Use ReadableStreamType from web-sys | diff --git a/src/readable/into_underlying_byte_source.rs b/src/readable/into_underlying_byte_source.rs
index 1f9be79..aef6822 100644
--- a/src/readable/into_underlying_byte_source.rs
+++ b/src/readable/into_underlying_byte_source.rs
@@ -35,8 +35,8 @@ impl IntoUnderlyingByteSource {
#[wasm_bindgen]
impl IntoUnderlying... | 2 | 3 | 2 |
dcc119310a21dda7d2a2e2f77bc77baebfccc7d5 | Mattias Buelens | 2024-09-27T23:08:01 | Use StreamPipeOptions from web-sys | diff --git a/src/readable/pipe_options.rs b/src/readable/pipe_options.rs
index 76d1a8d..58ad095 100644
--- a/src/readable/pipe_options.rs
+++ b/src/readable/pipe_options.rs
@@ -1,4 +1,3 @@
-use wasm_bindgen::JsCast;
use web_sys::AbortSignal;
use super::sys;
@@ -6,10 +5,7 @@ use super::sys;
/// Options for [`pipe_t... | 2 | 9 | 60 |
1bd69367cfdb960c6b3b949466e4b1957cd26593 | Mattias Buelens | 2024-09-27T22:57:34 | Use ReadableStreamReadResult from web-sys | diff --git a/src/readable/byob_reader.rs b/src/readable/byob_reader.rs
index cb20279..bb722b4 100644
--- a/src/readable/byob_reader.rs
+++ b/src/readable/byob_reader.rs
@@ -118,10 +118,10 @@ impl<'stream> ReadableStreamBYOBReader<'stream> {
let promise = self.as_raw().read_with_array_buffer_view(&view);
... | 5 | 10 | 23 |
710824c0e837e37aae3a42f2b46f27cf5ddcefc4 | Mattias Buelens | 2024-09-27T22:49:38 | Use set_mode() | diff --git a/src/readable/byob_reader.rs b/src/readable/byob_reader.rs
index 4ab0579..cb20279 100644
--- a/src/readable/byob_reader.rs
+++ b/src/readable/byob_reader.rs
@@ -22,14 +22,13 @@ pub struct ReadableStreamBYOBReader<'stream> {
impl<'stream> ReadableStreamBYOBReader<'stream> {
pub(crate) fn new(stream: ... | 1 | 3 | 4 |
92308d200f8a9522f5c8b0cce382a8d413b7484b | Mattias Buelens | 2024-09-27T22:46:36 | Fix lint warnings from cargo doc | diff --git a/src/lib.rs b/src/lib.rs
index df95731..7ec7372 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,8 +1,7 @@
//! Working with the Web [Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API)
//! in Rust.
//!
-//! This crate provides wrappers around [`ReadableStream`](crate::ReadableStream)... | 3 | 9 | 10 |
d3ea13afbec72c3297311981a41a97f787719db0 | Mattias Buelens | 2024-09-27T22:44:19 | Use QueuingStrategy from web-sys | diff --git a/src/queuing_strategy/mod.rs b/src/queuing_strategy/mod.rs
index c19c2be..f6f7e36 100644
--- a/src/queuing_strategy/mod.rs
+++ b/src/queuing_strategy/mod.rs
@@ -1,38 +1,19 @@
-use js_sys::Object;
-use wasm_bindgen::prelude::*;
+pub mod sys;
-#[wasm_bindgen]
-extern "C" {
- #[wasm_bindgen(extends = Obje... | 4 | 15 | 30 |
81c49243c9684579dc24cc73ad4556ddd561f006 | Mattias Buelens | 2024-09-27T22:36:29 | Update links to external docs | diff --git a/src/lib.rs b/src/lib.rs
index b7802af..df95731 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -5,9 +5,9 @@
//! [`WritableStream`](crate::WritableStream) and [`TransformStream`](crate::TransformStream).
//! It also supports converting from and into [`Stream`]s and [`Sink`]s from the [futures] crate.
//!
-//... | 14 | 46 | 46 |
6af6046aacbce7aea807974b0496b33d76677b11 | Mattias Buelens | 2024-09-27T22:33:09 | Update dependencies | diff --git a/Cargo.toml b/Cargo.toml
index 4e6640f..8c08a4e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,13 +17,13 @@ exclude = [
crate-type = ["cdylib", "rlib"]
[dependencies]
-js-sys = "^0.3.64"
-wasm-bindgen = "0.2.87"
-wasm-bindgen-futures = "^0.4.37"
-futures-util = { version = "^0.3.28", features = ["io", ... | 1 | 8 | 8 |
7c6eea5f2431de082e71bf663c5fd4abf624b3ba | Mattias Buelens | 2024-09-27T22:18:03 | Check for unhandled errors and rejections in test | diff --git a/Cargo.toml b/Cargo.toml
index 8d78e75..54d624e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -53,12 +53,15 @@ features = [
wasm-bindgen-test = "0.3.37"
tokio = { version = "^1", features = ["macros", "rt"] }
pin-project = "^1.1.3"
+gloo-timers = { version = "^0.3.0", features = ["futures"] }
[dev-depen... | 5 | 81 | 0 |
31e9be84d16e4fa63fd13d1d0f7b1e6dc0d352dc | Julian Ostarek | 2024-09-27T22:26:03 | Fix dropped closure exception for `IntoStream` and `IntoAsyncRead` (#25) | diff --git a/src/readable/into_async_read.rs b/src/readable/into_async_read.rs
index 35304d5..f15b08b 100644
--- a/src/readable/into_async_read.rs
+++ b/src/readable/into_async_read.rs
@@ -137,7 +137,9 @@ impl<'reader> Drop for IntoAsyncRead<'reader> {
fn drop(&mut self) {
if self.cancel_on_drop {
... | 2 | 6 | 2 |
27ec304db59874764e418db81a62f85ae20244fd | Mattias Buelens | 2023-10-31T19:01:46 | Fix formatting | diff --git a/src/readable/mod.rs b/src/readable/mod.rs
index 1e5f5c4..7e0491b 100644
--- a/src/readable/mod.rs
+++ b/src/readable/mod.rs
@@ -3,8 +3,8 @@
use futures_util::io::AsyncRead;
use futures_util::Stream;
use js_sys::Object;
-use wasm_bindgen::JsCast;
use wasm_bindgen::prelude::*;
+use wasm_bindgen::JsCast;
... | 1 | 1 | 1 |
1ac0e497d2c8ca7aa0f3523c0ba1f946ea45be80 | Mattias Buelens | 2023-10-31T18:55:20 | Ignore test if browser doesn't support ReadableStream.from() | diff --git a/tests/tests/readable_stream.rs b/tests/tests/readable_stream.rs
index 30311b2..fec2076 100644
--- a/tests/tests/readable_stream.rs
+++ b/tests/tests/readable_stream.rs
@@ -303,7 +303,18 @@ async fn test_readable_stream_into_stream_then_into_async_read() {
async fn test_readable_stream_from_js_array() {
... | 1 | 12 | 1 |
1699580f6af563c1d33929d08c7e4f6714c7a509 | Mattias Buelens | 2023-10-31T18:48:27 | Add ReadableStream::try_from() | diff --git a/src/readable/mod.rs b/src/readable/mod.rs
index 2afe280..1e5f5c4 100644
--- a/src/readable/mod.rs
+++ b/src/readable/mod.rs
@@ -3,8 +3,8 @@
use futures_util::io::AsyncRead;
use futures_util::Stream;
use js_sys::Object;
-use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
+use wasm_bindgen::prelude:... | 1 | 22 | 6 |
b8eeb06ec4a935378bd56ecc0ac798737d2b0b2e | Mattias Buelens | 2023-10-31T18:34:05 | Add test | diff --git a/tests/tests/readable_stream.rs b/tests/tests/readable_stream.rs
index c353178..30311b2 100644
--- a/tests/tests/readable_stream.rs
+++ b/tests/tests/readable_stream.rs
@@ -298,3 +298,17 @@ async fn test_readable_stream_into_stream_then_into_async_read() {
assert_eq!(async_read.read(&mut buf).await.unw... | 1 | 14 | 0 |
97fc45f8f39439570981f6b1ef17b88cbf2e8abf | Mattias Buelens | 2023-10-31T18:28:09 | Document panics | diff --git a/src/readable/mod.rs b/src/readable/mod.rs
index e064244..2afe280 100644
--- a/src/readable/mod.rs
+++ b/src/readable/mod.rs
@@ -104,6 +104,9 @@ impl ReadableStream {
/// This can be used to adapt various kinds of objects into a readable stream,
/// such as an [array], an [async generator] or a [N... | 1 | 3 | 0 |
00f4667542fea51f8e2be38c0193892ccebd1b0e | Mattias Buelens | 2023-10-31T18:25:42 | Use from_raw() internally | diff --git a/src/readable/mod.rs b/src/readable/mod.rs
index f4f1d41..e064244 100644
--- a/src/readable/mod.rs
+++ b/src/readable/mod.rs
@@ -73,7 +73,7 @@ impl ReadableStream {
let strategy = QueuingStrategy::new(0.0);
let raw = sys::ReadableStreamExt::new_with_into_underlying_source(source, strategy)... | 2 | 4 | 4 |
c6bae2769c234bb0d212d33f3c619994bf11371a | Mattias Buelens | 2023-10-31T18:24:36 | Add ReadableStream::from() | diff --git a/src/readable/mod.rs b/src/readable/mod.rs
index c47d969..f4f1d41 100644
--- a/src/readable/mod.rs
+++ b/src/readable/mod.rs
@@ -2,6 +2,7 @@
//! [readable streams](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream).
use futures_util::io::AsyncRead;
use futures_util::Stream;
+use js_sys::Obj... | 2 | 22 | 0 |
f0ac76b39e506b68cdbbf48deb0bd94dfa3d2b20 | Mattias Buelens | 2023-10-31T17:57:17 | Fix comment | diff --git a/src/transform/sys.rs b/src/transform/sys.rs
index 2a8ab85..fa73cb5 100644
--- a/src/transform/sys.rs
+++ b/src/transform/sys.rs
@@ -1,4 +1,4 @@
//! Raw bindings to JavaScript objects used
//! by a [`TransformStream`](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream).
-//! These are re-exp... | 1 | 1 | 1 |
5731f53a53447d7fc497b2b54b17860520100676 | Mattias Buelens | 2023-10-31T17:49:04 | Use dedicated setters for PipeOptions | diff --git a/src/readable/pipe_options.rs b/src/readable/pipe_options.rs
index e7d3188..76d1a8d 100644
--- a/src/readable/pipe_options.rs
+++ b/src/readable/pipe_options.rs
@@ -33,14 +33,14 @@ impl PipeOptions {
/// Convert this to a raw [`PipeOptions`](sys::PipeOptions) object.
pub fn into_raw(self) -> sys... | 2 | 22 | 7 |
a44a69c40d6f959082b909292982a90fd3ebc4a2 | Mattias Buelens | 2023-10-31T17:38:36 | Bring back PipeOptions::from_raw() | diff --git a/src/readable/pipe_options.rs b/src/readable/pipe_options.rs
index 7863ab6..e7d3188 100644
--- a/src/readable/pipe_options.rs
+++ b/src/readable/pipe_options.rs
@@ -1,3 +1,4 @@
+use wasm_bindgen::JsCast;
use web_sys::AbortSignal;
use super::sys;
@@ -19,15 +20,16 @@ impl PipeOptions {
Default::d... | 2 | 32 | 9 |
dc24b46a778365d8142592f7d43509ba5bdb431d | Mattias Buelens | 2023-10-07T11:06:09 | Rework QueuingStrategy | diff --git a/src/queuing_strategy/mod.rs b/src/queuing_strategy/mod.rs
index 2ce7024..c19c2be 100644
--- a/src/queuing_strategy/mod.rs
+++ b/src/queuing_strategy/mod.rs
@@ -1,37 +1,38 @@
+use js_sys::Object;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
-#[derive(Debug)]
-pub(crate) struct QueuingStrategy {
- hi... | 1 | 20 | 19 |
70000d3fad3e41305c64a278af8be0a2dd66b469 | Mattias Buelens | 2023-10-07T10:53:45 | Reformat | diff --git a/src/writable/sys.rs b/src/writable/sys.rs
index 911c1d1..03187db 100644
--- a/src/writable/sys.rs
+++ b/src/writable/sys.rs
@@ -15,7 +15,5 @@ extern "C" {
pub(crate) type WritableStreamExt;
#[wasm_bindgen(constructor, js_class = WritableStream)]
- pub(crate) fn new_with_into_underlying_sink(... | 1 | 1 | 3 |
00309ae8f3f0641d24975fa30fd497438e965233 | Mattias Buelens | 2023-10-07T10:53:35 | Add QueuingStrategy::from_raw | diff --git a/src/queuing_strategy/mod.rs b/src/queuing_strategy/mod.rs
index 7469b6f..2ce7024 100644
--- a/src/queuing_strategy/mod.rs
+++ b/src/queuing_strategy/mod.rs
@@ -11,6 +11,15 @@ impl QueuingStrategy {
Self { high_water_mark }
}
+ #[cfg(web_sys_unstable_apis)]
+ pub fn from_raw(raw: web_s... | 1 | 9 | 0 |
2f24e0d05f49e126483112dd3e1906b36b588a38 | Mattias Buelens | 2023-10-07T09:13:36 | Fix dependency | diff --git a/Cargo.toml b/Cargo.toml
index cae3029..fd49bb2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,7 +20,7 @@ crate-type = ["cdylib", "rlib"]
js-sys = "^0.3.64"
wasm-bindgen = "0.2.87"
wasm-bindgen-futures = "^0.4.37"
-futures-util = { version = "0.3.28", features = ["io", "sink"] }
+futures-util = { versio... | 1 | 1 | 1 |
7751f2b96c6bd5645a7c7fa3732e90a9aa15b045 | Mattias Buelens | 2023-10-07T09:12:11 | Update doc links | diff --git a/src/lib.rs b/src/lib.rs
index 327c5be..b7802af 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -5,9 +5,9 @@
//! [`WritableStream`](crate::WritableStream) and [`TransformStream`](crate::TransformStream).
//! It also supports converting from and into [`Stream`]s and [`Sink`]s from the [futures] crate.
//!
-//... | 11 | 43 | 43 |
5c6b90c721de08ba1d19a3e8e35b719bf6ed3856 | Mattias Buelens | 2023-10-07T09:09:45 | Remove useless `catch` | diff --git a/src/readable/mod.rs b/src/readable/mod.rs
index c09ed48..e2ece84 100644
--- a/src/readable/mod.rs
+++ b/src/readable/mod.rs
@@ -2,8 +2,8 @@
//! [readable streams](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream).
use futures_util::io::AsyncRead;
use futures_util::Stream;
+use wasm_bindge... | 4 | 6 | 11 |
af46fbae379322a102317a0186a74312bf962af7 | Mattias Buelens | 2023-10-07T08:33:00 | Combine ReadResult type for default and BYOB reader | diff --git a/src/readable/byob_reader.rs b/src/readable/byob_reader.rs
index 36c473f..4f90e40 100644
--- a/src/readable/byob_reader.rs
+++ b/src/readable/byob_reader.rs
@@ -117,15 +117,15 @@ impl<'stream> ReadableStreamBYOBReader<'stream> {
let view = buffer.subarray(0, dst_len).unchecked_into::<Object>();
... | 5 | 22 | 34 |
5bc94c6800c590b35d11c25d9ceeee8e30299f7d | Mattias Buelens | 2023-10-07T08:20:12 | Bring back dedicated constructors for IntoSource/Sink | diff --git a/src/readable/into_underlying_byte_source.rs b/src/readable/into_underlying_byte_source.rs
index 37c74d6..1f9be79 100644
--- a/src/readable/into_underlying_byte_source.rs
+++ b/src/readable/into_underlying_byte_source.rs
@@ -29,10 +29,6 @@ impl IntoUnderlyingByteSource {
pull_handle: None,
... | 7 | 46 | 22 |
b2d0e69531ec92364c9f7f14d891e02cc1a9c8cd | Mattias Buelens | 2023-09-30T14:47:47 | Bring back error handling for tee() | diff --git a/src/readable/mod.rs b/src/readable/mod.rs
index a2ee494..64c9638 100644
--- a/src/readable/mod.rs
+++ b/src/readable/mod.rs
@@ -259,10 +259,11 @@ impl ReadableStream {
/// If the stream is already locked to a reader, then this returns an error
/// along with the original `ReadableStream`.
pu... | 2 | 9 | 5 |
e48278a42eef318dd9ff98d7e91d6ee114194e1a | Mattias Buelens | 2023-09-30T14:38:25 | Bring back error handling for releaseLock() | diff --git a/src/readable/byob_reader.rs b/src/readable/byob_reader.rs
index e3b01ad..36c473f 100644
--- a/src/readable/byob_reader.rs
+++ b/src/readable/byob_reader.rs
@@ -176,8 +176,10 @@ impl<'stream> ReadableStreamBYOBReader<'stream> {
/// return an error and leave the reader locked to the stream.
#[inlin... | 3 | 18 | 4 |
8f97cc3f8b04837a7daef3aded8cf82f8856276f | Mattias Buelens | 2023-09-30T14:32:23 | Bring back error handling for ReadableStream.getReader() | diff --git a/src/readable/byob_reader.rs b/src/readable/byob_reader.rs
index 1ea3254..e3b01ad 100644
--- a/src/readable/byob_reader.rs
+++ b/src/readable/byob_reader.rs
@@ -22,16 +22,14 @@ pub struct ReadableStreamBYOBReader<'stream> {
impl<'stream> ReadableStreamBYOBReader<'stream> {
pub(crate) fn new(stream: ... | 3 | 24 | 10 |
7c6d4b7a4ff339f661cf1cd736a4081441513989 | Mattias Buelens | 2023-09-30T14:19:54 | Fix formatting and lint warnings | diff --git a/src/readable/byob_reader.rs b/src/readable/byob_reader.rs
index 05aac4b..1ea3254 100644
--- a/src/readable/byob_reader.rs
+++ b/src/readable/byob_reader.rs
@@ -26,10 +26,13 @@ impl<'stream> ReadableStreamBYOBReader<'stream> {
return Err(js_sys::Error::new("Already locked"));
}
... | 7 | 27 | 24 |
172519529933c1d680b833694b6e52b8eba155e0 | Mattias Buelens | 2023-09-30T14:17:03 | Add fetch_as_stream test | diff --git a/tests/tests/fetch_as_stream.rs b/tests/tests/fetch_as_stream.rs
new file mode 100644
index 0000000..a12d381
--- /dev/null
+++ b/tests/tests/fetch_as_stream.rs
@@ -0,0 +1,37 @@
+use futures_util::{AsyncReadExt, TryStreamExt};
+use js_sys::Uint8Array;
+use wasm_bindgen::prelude::*;
+use wasm_bindgen::JsCast;... | 2 | 38 | 0 |
10a0147df4f4afbe7b1d5eb1fdafdae9d38eae95 | Mattias Buelens | 2023-09-30T14:06:42 | Simplify example | diff --git a/examples/fetch_as_stream.rs b/examples/fetch_as_stream.rs
index f5332b8..7e18af1 100644
--- a/examples/fetch_as_stream.rs
+++ b/examples/fetch_as_stream.rs
@@ -22,7 +22,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Get the response's body as a JS ReadableStream
let raw_bod... | 1 | 1 | 1 |
eb95927faebbdcb641b440259b8fec1099aec2c9 | Mattias Buelens | 2023-09-30T11:01:23 | Keep custom ReadResult types private | diff --git a/src/readable/into_stream.rs b/src/readable/into_stream.rs
index 92f57d2..769decf 100644
--- a/src/readable/into_stream.rs
+++ b/src/readable/into_stream.rs
@@ -7,7 +7,7 @@ use futures_util::FutureExt;
use wasm_bindgen::prelude::*;
use wasm_bindgen_futures::JsFuture;
-use super::sys::ReadableStreamReadR... | 2 | 8 | 11 |
e8d497f80d76f658ffc6b08081c3f03c50ec7361 | Mattias Buelens | 2023-09-30T09:30:12 | Update dependencies | diff --git a/Cargo.toml b/Cargo.toml
index 10f4349..c2dfbe4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,24 +17,24 @@ exclude = [
crate-type = ["cdylib", "rlib"]
[dependencies]
-js-sys = "^0.3.47"
-wasm-bindgen = "0.2.73"
-wasm-bindgen-futures = "^0.4.20"
-futures-util = { version = "0.3.21", features = ["io", "... | 1 | 8 | 8 |
d4a59fe76f60da85ce21be8b69f4a9a57c17b157 | Mattias Buelens | 2022-11-08T20:08:47 | Forward errors from controller and BYOB request methods | diff --git a/src/readable/into_underlying_byte_source.rs b/src/readable/into_underlying_byte_source.rs
index 12483dc..0a77ca2 100644
--- a/src/readable/into_underlying_byte_source.rs
+++ b/src/readable/into_underlying_byte_source.rs
@@ -113,8 +113,8 @@ impl Inner {
Ok(0) => {
// The stream... | 3 | 23 | 17 |
a8cf23b053879e46fc5f38853e5be0c4c8501eaf | Mattias Buelens | 2022-11-08T19:59:34 | Stop calling byobRequest.respond(0) on cancel | diff --git a/src/readable/into_underlying_byte_source.rs b/src/readable/into_underlying_byte_source.rs
index 2ceb141..12483dc 100644
--- a/src/readable/into_underlying_byte_source.rs
+++ b/src/readable/into_underlying_byte_source.rs
@@ -78,10 +78,6 @@ impl Drop for IntoUnderlyingByteSource {
if let Some(handle... | 1 | 2 | 32 |
a753e316f6c9beb0f02514ce4b9b720c5412d60c | Mattias Buelens | 2022-10-15T22:27:45 | Fix clippy warnings | diff --git a/tests/tests/readable_byte_stream.rs b/tests/tests/readable_byte_stream.rs
index a7de7ad..a3c6e5c 100644
--- a/tests/tests/readable_byte_stream.rs
+++ b/tests/tests/readable_byte_stream.rs
@@ -204,7 +204,7 @@ async fn test_readable_byte_stream_multiple_byob_readers() {
assert!(!readable.is_locked());
... | 2 | 1 | 2 |
a3747706f3afb9e7502ec1f6d3777d23a390af9e | Mattias Buelens | 2022-10-15T13:35:00 | Revert "Work around Chromium bug with { type: "bytes" }"
This reverts commit 67bb2a413bc3ba2ff8de0a4a18fbb0e3ac59899b. | diff --git a/src/readable/into_underlying_byte_source.rs b/src/readable/into_underlying_byte_source.rs
index e175281..2ceb141 100644
--- a/src/readable/into_underlying_byte_source.rs
+++ b/src/readable/into_underlying_byte_source.rs
@@ -31,24 +31,12 @@ impl IntoUnderlyingByteSource {
}
}
-#[wasm_bindgen(inline_... | 1 | 2 | 14 |
c4a1e6049a1c934c0b7dfa6609e5522577f74820 | Mattias Buelens | 2022-10-15T20:52:34 | Wrong year | diff --git a/src/readable/byob_reader.rs b/src/readable/byob_reader.rs
index bf9a450..61490f1 100644
--- a/src/readable/byob_reader.rs
+++ b/src/readable/byob_reader.rs
@@ -143,7 +143,7 @@ impl<'stream> ReadableStreamBYOBReader<'stream> {
/// [Releases](https://streams.spec.whatwg.org/#release-a-lock) this reader'... | 2 | 4 | 4 |
28767dea0eae5c72ca5f4ab815a385b8eec4a48c | Mattias Buelens | 2022-10-15T20:39:44 | Update documentation on drop behaviors | diff --git a/src/readable/byob_reader.rs b/src/readable/byob_reader.rs
index ef053dd..bf9a450 100644
--- a/src/readable/byob_reader.rs
+++ b/src/readable/byob_reader.rs
@@ -14,9 +14,6 @@ use super::{sys, IntoAsyncRead, ReadableStream};
/// This is returned by the [`get_byob_reader`](ReadableStream::get_byob_reader) me... | 4 | 0 | 20 |
d001e4fa8d7b05d4191c18a893042e73e9c0b936 | Mattias Buelens | 2022-10-15T20:21:56 | Update documentation for release_lock() | diff --git a/src/readable/byob_reader.rs b/src/readable/byob_reader.rs
index 2130359..ef053dd 100644
--- a/src/readable/byob_reader.rs
+++ b/src/readable/byob_reader.rs
@@ -146,9 +146,14 @@ impl<'stream> ReadableStreamBYOBReader<'stream> {
/// [Releases](https://streams.spec.whatwg.org/#release-a-lock) this reader... | 2 | 30 | 10 |
99b3e8c9a0e32425e34b6521f69726f51f7ad0d0 | Mattias Buelens | 2022-05-18T17:43:19 | Fix lint warning | diff --git a/tests/util/simple_channel.rs b/tests/util/simple_channel.rs
index 0c1c24c..254b6e0 100644
--- a/tests/util/simple_channel.rs
+++ b/tests/util/simple_channel.rs
@@ -136,7 +136,7 @@ mod tests {
#[tokio::test]
async fn test_close_then_read() {
let channel = SimpleChannel::<u32>::new();
- ... | 1 | 1 | 1 |
38e5276958b4912bd3d8ceab0e6cc073cabde8eb | Mattias Buelens | 2022-05-18T17:31:04 | Add tests for SimpleChannel | diff --git a/tests/util/simple_channel.rs b/tests/util/simple_channel.rs
index 25379af..0c1c24c 100644
--- a/tests/util/simple_channel.rs
+++ b/tests/util/simple_channel.rs
@@ -72,3 +72,86 @@ impl<T> Sink<T> for SimpleChannel<T> {
Poll::Ready(Ok(()))
}
}
+
+#[cfg(test)]
+mod tests {
+ use futures_util... | 1 | 83 | 0 |
f6d8e7f9c0c71aa516a18d0dca4092d44951cba6 | Mattias Buelens | 2022-05-18T17:00:32 | Update to Rust edition 2021 | diff --git a/Cargo.toml b/Cargo.toml
index 8c9c2d6..490a298 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,7 +2,7 @@
name = "wasm-streams"
version = "0.2.2"
authors = ["Mattias Buelens <mattias@buelens.com>"]
-edition = "2018"
+edition = "2021"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "http... | 1 | 1 | 1 |
e8c355abf3006c2c649e7c09d0dd7d3a30b55c0d | Mattias Buelens | 2022-05-18T16:58:35 | Replace mpsc::unbounded with SimpleChannel | diff --git a/Cargo.toml b/Cargo.toml
index 9bfb9c4..8c9c2d6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,12 +29,6 @@ features = [
]
[dev-dependencies]
-# TODO: Investigate why using `futures-channel` does not work.
-# In theory, there is no reason why `futures` is required here.
-# The `futures-channel` is suffi... | 3 | 4 | 11 |
c858466f598270bd3f3634f532c520b0b538eb63 | Mattias Buelens | 2022-05-18T16:58:05 | Add SimpleChannel for Stream/Sink pair | diff --git a/tests/util/mod.rs b/tests/util/mod.rs
index bbc94aa..551664d 100644
--- a/tests/util/mod.rs
+++ b/tests/util/mod.rs
@@ -1,5 +1,7 @@
pub use byte_channel::ByteChannel;
pub use drop_observer::observe_drop;
+pub use simple_channel::SimpleChannel;
pub mod byte_channel;
pub mod drop_observer;
+pub mod sim... | 2 | 76 | 0 |
4553fa3f45e3073c7cc9594d05831d211212e090 | Basti Ortiz | 2022-05-18T10:52:53 | Fix: use temporary workaround for test compilation failures
For some reason, using the `futures-channel` crate over the `futures`
crate causes compilation errors. This is very strange because the
`futures::channel` module from the `futures` crate is literally just
re-exported from the `futures-channel` crate!
Despite... | diff --git a/Cargo.toml b/Cargo.toml
index 7ad5513..9bfb9c4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,7 +20,7 @@ crate-type = ["cdylib", "rlib"]
js-sys = "^0.3.47"
wasm-bindgen = "0.2.73"
wasm-bindgen-futures = "^0.4.20"
-futures-util = { version = "0.3.21", default-features = false, features = ["alloc", "asyn... | 3 | 9 | 4 |
3a32b2eb2b52cbb51cdfba36bb7b7d86c195b22a | Basti Ortiz | 2022-05-18T10:36:38 | Format: run `cargo fmt` | diff --git a/src/readable/into_async_read.rs b/src/readable/into_async_read.rs
index c46b6ad..4333a65 100644
--- a/src/readable/into_async_read.rs
+++ b/src/readable/into_async_read.rs
@@ -1,9 +1,9 @@
use core::pin::Pin;
use core::task::{Context, Poll};
-use futures_util::FutureExt;
use futures_util::io::{AsyncRea... | 5 | 5 | 5 |
b9f7439538fd3fa64b26b5bc3a1eb86c224b24d1 | Basti Ortiz | 2022-05-18T10:34:32 | Chore: use explicit import | diff --git a/tests/tests/writable_stream.rs b/tests/tests/writable_stream.rs
index b7ce6fd..5a45b0e 100644
--- a/tests/tests/writable_stream.rs
+++ b/tests/tests/writable_stream.rs
@@ -1,6 +1,6 @@
use std::pin::Pin;
-use futures_channel::*;
+use futures_channel::mpsc;
use futures_util::stream::iter;
use futures_ut... | 1 | 1 | 1 |
1dba9b735a58fcd5c5eae386afb805a21dc6f972 | Basti Ortiz | 2022-05-18T10:18:12 | Deps: move `futures-channel` to `devDependencies` | diff --git a/Cargo.toml b/Cargo.toml
index 80ab4b8..7ad5513 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,7 +20,6 @@ crate-type = ["cdylib", "rlib"]
js-sys = "^0.3.47"
wasm-bindgen = "0.2.73"
wasm-bindgen-futures = "^0.4.20"
-futures-channel = "0.3.21"
futures-util = { version = "0.3.21", default-features = false... | 1 | 1 | 1 |
44cb494b672bb7d78988aa2bacfd475c0f7a1469 | Basti Ortiz | 2022-05-18T10:10:54 | Fix: rename appropriate imports | diff --git a/src/readable/into_async_read.rs b/src/readable/into_async_read.rs
index 30ce1f7..c46b6ad 100644
--- a/src/readable/into_async_read.rs
+++ b/src/readable/into_async_read.rs
@@ -1,9 +1,9 @@
use core::pin::Pin;
+use core::task::{Context, Poll};
-use futures::future::FutureExt;
-use futures::io::{AsyncRead,... | 9 | 22 | 23 |
0a485e286d66538c4678d504881c453b961058f5 | Basti Ortiz | 2022-05-18T10:10:39 | Chore: fix tests | diff --git a/tests/tests/pipe.rs b/tests/tests/pipe.rs
index 6591d23..48be589 100644
--- a/tests/tests/pipe.rs
+++ b/tests/tests/pipe.rs
@@ -1,6 +1,6 @@
-use futures::channel::mpsc;
-use futures::stream::iter;
-use futures::{SinkExt, StreamExt};
+use futures_channel::mpsc;
+use futures_util::stream::iter;
+use futures_... | 7 | 20 | 21 |
23e54255b5bcd83db338c9c2b71c95e79101b2da | Basti Ortiz | 2022-05-18T10:10:12 | Chore: fix examples | diff --git a/examples/fetch_as_stream.rs b/examples/fetch_as_stream.rs
index 8ad0c04..f5332b8 100644
--- a/examples/fetch_as_stream.rs
+++ b/examples/fetch_as_stream.rs
@@ -3,7 +3,7 @@
//! This example makes an HTTP request using `fetch()` from `web-sys`,
//! and then consumes the response body as a Rust `Stream`.
... | 1 | 1 | 1 |
04f23f4d451ec3b0f5a4e2243dc798a2f6544795 | Basti Ortiz | 2022-05-18T10:09:50 | Deps: remove `futures` crate | diff --git a/Cargo.toml b/Cargo.toml
index 5f456d4..80ab4b8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,7 +20,8 @@ crate-type = ["cdylib", "rlib"]
js-sys = "^0.3.47"
wasm-bindgen = "0.2.73"
wasm-bindgen-futures = "^0.4.20"
-futures = "^0.3.12"
+futures-channel = "0.3.21"
+futures-util = { version = "0.3.21", def... | 1 | 2 | 1 |
dff05d77513cc1d590c21cd251a63b43cf520fed | Mattias Buelens | 2021-12-09T20:39:20 | Fix documentation links | diff --git a/src/lib.rs b/src/lib.rs
index 1922781..327c5be 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,8 +3,11 @@
//!
//! This crate provides wrappers around [`ReadableStream`](crate::ReadableStream),
//! [`WritableStream`](crate::WritableStream) and [`TransformStream`](crate::TransformStream).
-//! It also supp... | 11 | 104 | 49 |
caf1c248bd18ed00673a1db389f5c8ab4e92a11e | Mattias Buelens | 2021-12-09T20:12:32 | Fix line endings | diff --git a/tests/unit.rs b/tests/unit.rs
index 8577088..812d1ed 100644
--- a/tests/unit.rs
+++ b/tests/unit.rs
@@ -1 +1 @@
-pub mod util;
+pub mod util;
diff --git a/tests/util/byte_channel.rs b/tests/util/byte_channel.rs
index 32b0d9e..898b485 100644
--- a/tests/util/byte_channel.rs
+++ b/tests/util/byte_channel.rs... | 2 | 154 | 154 |
84a3bb9e2854daf48ee6134f1dfc7ab3dc768cf8 | Mattias Buelens | 2021-12-02T23:26:12 | Build only one target on docs.rs | diff --git a/Cargo.toml b/Cargo.toml
index 055e175..8707fb7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -42,3 +42,7 @@ features = [
"ReadableStream",
"Window",
]
+
+[package.metadata.docs.rs]
+# https://blog.rust-lang.org/2020/03/15/docs-rs-opt-into-fewer-targets.html
+targets = ["x86_64-unknown-linux-gnu"] | 1 | 4 | 0 |
85e5f2826d12f37257fe1c16f18b8ef105927a33 | Mattias Buelens | 2021-12-09T19:48:37 | Reformat | diff --git a/src/readable/into_async_read.rs b/src/readable/into_async_read.rs
index fe3a7bf..6291d44 100644
--- a/src/readable/into_async_read.rs
+++ b/src/readable/into_async_read.rs
@@ -81,29 +81,29 @@ impl<'reader> AsyncRead for IntoAsyncRead<'reader> {
let read_fut = match self.fut.as_mut() {
... | 1 | 22 | 22 |
afdad75bc070751ceacc860cf6ce2bc35d7bf7be | Mattias Buelens | 2021-12-09T19:48:23 | Simplify handling futures inside IntoStream/Sink/AsyncRead | diff --git a/src/readable/into_async_read.rs b/src/readable/into_async_read.rs
index dc8a74b..fe3a7bf 100644
--- a/src/readable/into_async_read.rs
+++ b/src/readable/into_async_read.rs
@@ -78,7 +78,9 @@ impl<'reader> AsyncRead for IntoAsyncRead<'reader> {
cx: &mut Context<'_>,
buf: &mut [u8],
) -... | 3 | 41 | 48 |
c0a5e68f138182f4fb08c1425f9f5a2ebfc30a14 | Mattias Buelens | 2021-12-09T19:33:45 | Fix comment | diff --git a/src/writable/into_sink.rs b/src/writable/into_sink.rs
index 065e25f..b52d49c 100644
--- a/src/writable/into_sink.rs
+++ b/src/writable/into_sink.rs
@@ -59,7 +59,7 @@ impl<'writer> Sink<JsValue> for IntoSink<'writer> {
fn poll_ready(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), S... | 1 | 1 | 1 |
6a91830c5f892446d50fcebb2e5532b13f091033 | Mattias Buelens | 2021-12-04T01:01:18 | Return when reading into empty buffer | diff --git a/tests/util/byte_channel.rs b/tests/util/byte_channel.rs
index 5e36281..9d02db6 100644
--- a/tests/util/byte_channel.rs
+++ b/tests/util/byte_channel.rs
@@ -24,7 +24,7 @@ impl AsyncRead for ByteChannel {
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<std::io::Result<usize>> {
- ... | 1 | 10 | 1 |
7728420f43dddeabad94bfa675bb43df9bcfb591 | Mattias Buelens | 2021-12-04T00:57:41 | Use Default | diff --git a/tests/util/byte_channel.rs b/tests/util/byte_channel.rs
index 8a85750..5e36281 100644
--- a/tests/util/byte_channel.rs
+++ b/tests/util/byte_channel.rs
@@ -5,6 +5,7 @@ use std::task::{Context, Poll, Waker};
use futures::{AsyncRead, AsyncWrite};
+#[derive(Debug, Default)]
pub struct ByteChannel {
... | 1 | 2 | 5 |
242d7be190dc96a34ff7f10d44771294d884d6ed | Mattias Buelens | 2021-12-04T00:57:12 | Add tricky test | diff --git a/tests/util/byte_channel.rs b/tests/util/byte_channel.rs
index 171f95d..8a85750 100644
--- a/tests/util/byte_channel.rs
+++ b/tests/util/byte_channel.rs
@@ -128,4 +128,20 @@ mod tests {
)
.await;
}
+
+ #[tokio::test]
+ async fn test_close_then_read() {
+ let channel... | 1 | 16 | 0 |
293efa3d685d9bfd140fa89d3017aa4107ade86e | Mattias Buelens | 2021-12-04T00:53:30 | Test WritableStream::from_sink using an adapted AsyncWrite | diff --git a/tests/tests/writable_stream.rs b/tests/tests/writable_stream.rs
index 99cd7de..e76eaf8 100644
--- a/tests/tests/writable_stream.rs
+++ b/tests/tests/writable_stream.rs
@@ -2,14 +2,16 @@ use std::pin::Pin;
use futures::channel::*;
use futures::stream::iter;
-use futures::{AsyncWriteExt, SinkExt, StreamE... | 1 | 34 | 1 |
4e752d33382ebea37d9cd0a493b1fadb45f77f44 | Mattias Buelens | 2021-12-04T00:43:59 | Add ByteChannel for testing AsyncRead/AsyncWrite | diff --git a/tests/unit.rs b/tests/unit.rs
new file mode 100644
index 0000000..8577088
--- /dev/null
+++ b/tests/unit.rs
@@ -0,0 +1 @@
+pub mod util;
diff --git a/tests/util/byte_channel.rs b/tests/util/byte_channel.rs
new file mode 100644
index 0000000..171f95d
--- /dev/null
+++ b/tests/util/byte_channel.rs
@@ -0,0 +... | 3 | 134 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.