rust-lang / ferris-says

A Rust flavored implementation of `cowsay`
https://crates.io/crates/ferris-says
Apache License 2.0
194 stars 34 forks source link

Example run wrong #35

Closed GOWxx closed 1 year ago

GOWxx commented 1 year ago

enviroments: macOs 13 Ventura

% rustup --version
rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.65.0 (897e37553 2022-11-02)`

% cargo --version
cargo 1.65.0 (4bc8f24d3 2022-10-20)

run wrong with

  let out = b"Hello fellow Rustaceans!"; // now, type of out is '&[u8; 24]'
  say(input: &str)
image

cargon run get an error.

image
gitSirzh commented 1 year ago

image

thoroc commented 1 year ago

Don't forget the type:

let out &str = "Hello fellow Rustaceans!";