Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Add WASI stubs #20

Merged
merged 3 commits into from
May 11, 2019
Merged

Add WASI stubs #20

merged 3 commits into from
May 11, 2019

Conversation

xen0n
Copy link
Contributor

@xen0n xen0n commented May 11, 2019

As discussed in #19, make everything return None on WASI. Also a cargo fmt run is done.

Copy link
Collaborator

@soc soc left a comment

Choose a reason for hiding this comment

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

Wow, thanks for the PR!

src/wasi.rs Outdated
pub fn data_local_dir() -> Option<PathBuf> { None }
pub fn runtime_dir() -> Option<PathBuf> { None }
pub fn executable_dir() -> Option<PathBuf> { None }
pub fn audio_dir() -> Option<PathBuf> { home_dir().map(|h| h.join("Music")) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you also use None for these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, sure. I just thought these to be sensible defaults though, of course not the case if the final API actually included specific support for such personal and interactive uses.

Copy link
Collaborator

@soc soc May 11, 2019

Choose a reason for hiding this comment

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

They all end up as None, because home_dir returns None. So writing None cuts to the chase. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I sometimes do things like this at work, since multiple people get to work on different parts of the same workflow, if someone finished their part the dataflow would automatically connect.

It's correct to assume nothing before platform stabilization, though.

@xen0n
Copy link
Contributor Author

xen0n commented May 11, 2019

Hmm, squashed and fixed a typo. AppVeyor is so slow...

@soc
Copy link
Collaborator

soc commented May 11, 2019

Thank you, @xen0n!

@soc soc merged commit 7c53ecd into dirs-dev:master May 11, 2019
@xen0n xen0n deleted the wasi-stubs branch May 11, 2019 16:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants