Skip to content

Commit

Permalink
uniformize File::is_ready for all targets
Browse files Browse the repository at this point in the history
  • Loading branch information
jice-nospam committed Jan 15, 2023
1 parent e8251e9 commit 167abd3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Changelog

## [0.3.2] - Unreleased
## [0.4.0] - Unreleased
### Added
- filesystem example in basic.rs
- URL support in filesystem API on native targets when enabling the http feature

This breaks API compatibility as File::is_ready(&self) becomes File::is_ready(&mut self)

## [0.3.1] - 2023-01-13
### Fixed
- fixed wasm target compilation
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "uni-app"
version = "0.3.2"
version = "0.4.0"
authors = [
"Edwin Cheng <[email protected]>",
"jice <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "uni-app-example"
version = "0.3.2"
version = "0.4.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/unrust/uni-app"
Expand Down
2 changes: 1 addition & 1 deletion src/native_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl File {
/// On web target, files are loaded asynchronously.
/// You have to poll [`File::is_ready`] until it returns true.
/// Only then you can call [`File::read_binary`] or [`File::read_text`].
pub fn is_ready(&self) -> bool {
pub fn is_ready(&mut self) -> bool {
true
}
}
2 changes: 1 addition & 1 deletion src/web_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl FileSystem {
}

impl File {
pub fn is_ready(&self) -> bool {
pub fn is_ready(&mut self) -> bool {
let bs = self.buffer_state.borrow();
match *bs {
BufferState::Empty => false,
Expand Down

0 comments on commit 167abd3

Please sign in to comment.