nuta / nsh

A command-line shell like fish, but POSIX compatible.
906 stars 34 forks source link

error when compiling nsh using cargo install #46

Open clemdemort opened 1 year ago

clemdemort commented 1 year ago
 Compiling nsh v0.4.2
error[E0061]: this function takes 0 arguments but 1 argument was supplied
    --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/nsh-0.4.2/src/prompt.rs:131:25
     |
131  |     let hostname_cstr = unistd::gethostname(&mut hostname_buf).expect("failed to get hostname");
     |                         ^^^^^^^^^^^^^^^^^^^ ----------------- argument of type `&mut [u8; 128]` unexpected
     |
note: function defined here
    --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.26.1/src/unistd.rs:1020:8
     |
1020 | pub fn gethostname() -> Result<OsString> {
     |        ^^^^^^^^^^^
help: remove the extra argument
     |
131  |     let hostname_cstr = unistd::gethostname().expect("failed to get hostname");
     |
metruzanca commented 1 year ago

I also got the same

SteveLauC commented 1 year ago

It seems that this is a duplicate of #44, and has been fixed in #45