Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Add warning when using load_folder on web #5827

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/bevy_asset/src/io/wasm_asset_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ impl AssetIo for WasmAssetIo {
&self,
_path: &Path,
) -> Result<Box<dyn Iterator<Item = PathBuf>>, AssetIoError> {
bevy_log::warn!("Loading folders is not supported in WASM");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep in line with the name of the method

Suggested change
bevy_log::warn!("Loading folders is not supported in WASM");
bevy_log::warn!("Reading a directory is not supported in WASM");

Copy link
Contributor Author

@rparrett rparrett Aug 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that this phrasing would be more useful to normal users who would see this message when attempting to use load_folder.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I guess that makes sense then since it's probably going to be the more common use case

Ok(Box::new(std::iter::empty::<PathBuf>()))
}

Expand Down