nsh icon indicating copy to clipboard operation
nsh copied to clipboard

error when compiling nsh using cargo install

Open clemdemort opened this issue 2 years ago • 2 comments

 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");
     |

clemdemort avatar Dec 20 '22 22:12 clemdemort