conradludgate / wordle

Wordle TUI in Rust
122 stars 21 forks source link

Update src/score.rs #18

Closed ci4ic4 closed 2 years ago

ci4ic4 commented 2 years ago

Using rust 1.57.0 on NetBSD-current, I am getting: error: there is no argument named score --> src/state.rs:112:20 | 112 | write!(w, "{score}/6{hard_mode}",)?; | ^^^^^^^

error: there is no argument named hard_mode --> src/state.rs:112:29 | 112 | write!(w, "{score}/6{hard_mode}",)?; | ^^^^^^^^^^^ ...

conradludgate commented 2 years ago

The previous syntax is valid on rust 1.58, so I won't accept this as it is.

However, I should make sure that people get suitable error messages, so if you want, if you could add rust_version = "1.58" to the Cargo.toml that would be much appreciated

ci4ic4 commented 2 years ago

I guess it will be local patches for NetBSD, as 1.57 is the latest version available at this time. Determining the local timezone also fails in src/game.rs, so invoking without an argument fails; otherwise it works.

conradludgate commented 2 years ago

I'd recommend using rustup instead of the OS's package manager to install Rust. It'll save you a lot of trouble

ci4ic4 commented 2 years ago

I'd recommend using rustup instead of the OS's package manager to install Rust. It'll save you a lot of trouble

This is probably so if you care mainly for Rust-based projects; if one maintains a wider set of packages, e.g., as it is in the NetBSD case, using pkgsrc, one would want to be able to update them in one go, in a consistent and tested manner. The same problem exists with go, python, haskell, perl5 etc... In the pkgsrc case, the latest Rust version comes briefly after the last released, so it usually is not a problem. Anyway, rustup did its job for me as well, on one of my other VMs: .. ➜ ~ =rustc --version rustc 1.58.1 (db9d1b20b 2022-01-20) ➜ ~ uname -a NetBSD nbuild.lorien.lan 9.99.93 NetBSD 9.99.93 (MINE_SMALL) #2: Thu Jan 27 23:26:42 GMT 2022 root@ymir:/home/sysbuild/qweqwe/usr/src/sys/arch/amd64/compile/MINE_SMALL amd64 ...