conradkleinespel / rpassword

Cross platform Rust library to read a password in the terminal (Linux, BSD, OSX, Windows, WASM).
Apache License 2.0
244 stars 38 forks source link

No WASM support. #38

Closed AchalaSB closed 4 years ago

AchalaSB commented 5 years ago

Hey, Seems like the library is not compatible with wasm

cargo build --target wasm32-unknown-unknown
   Compiling rpassword v4.0.1 (/home/achala/codes/rpassword)
error[E0425]: cannot find function `read_password_from_stdin` in this scope
   --> src/lib.rs:285:17
    |
285 |         None => read_password_from_stdin(false),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `read_password_from_tty`

error[E0425]: cannot find function `display_on_tty` in this scope
   --> src/lib.rs:293:9
    |
293 |         display_on_tty(prompt)?;
    |         ^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `read_password_from_stdin` in this scope
   --> src/lib.rs:295:5
    |
295 |     read_password_from_stdin(true)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `read_password_from_tty`

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0425`.
error: Could not compile `rpassword`.

To learn more, run the command again with --verbose.

Is this error because of compatibility? or the error coming from my end? How can I fix this? Thanks

conradkleinespel commented 4 years ago

@AchalaSB Hello ! I haven't used WASM myself so I wouldn't know, unfortunately. What have you tried ? Have you found a solution since you posted ? I'd love to know how you fixed it so we can fix it for everyone :+1:

conradkleinespel commented 4 years ago

@AchalaSB Without further feedback, I'll go ahead and close this issue. If someone else reads this and needs WASM support, feel free to open a PR. Cheers !