rust-canteen icon indicating copy to clipboard operation
rust-canteen copied to clipboard

Hello world example in README not compiling

Open andreheringer opened this issue 6 years ago • 3 comments

Hi Jeff,

It seems like you have updated canteen to a new minor version (0.4.1 according to my Cargo.lock file) and now the example "Hello world" code in the README does not work.

``error[E0061]: this function takes 1 parameter but 0 parameters were supplied --> src/main.rs:24:15 | 24 | let cnt = Canteen::new(); | ^^^^^^^^^^^^^^ expected 1 parameter

error[E0599]: no method named bind found for type canteen::Canteen in the current scope --> src/main.rs:27:9 | 27 | cnt.bind(("127.0.0.1", 8080)); | ^^^^

error: aborting due to 2 previous errors``

My guess is that you've moved the url and the port configuration to the Canteen::new method and removed the bind method.

I can open a small PR just to fix it. Let me know.

Cheers from Brazil :)

PS: Love the idea for Canteen, I'm a big fan of Flask as well. If you would like to take this project forward, and need some help, let me know.

PS 2: Found you on Are We Web Yet?

andreheringer avatar Sep 01 '19 04:09 andreheringer

Try using as a dependency canteen = "0.5" instead of using the 0.4 version specified on the README.md.

I had the same issue and this change solved it for me.

sebasrivera96 avatar Oct 09 '19 21:10 sebasrivera96

Yeah I've done the same and it worked. I actually posted this issue to see if the maintainer was still working on this repo, but I believe he moved it to Gitlab now. I've opened a PR for this #2

Jeff if you ever read this. Canteen is nice, hope you're still working on it. Hit me up if you think you could use some help.

andreheringer avatar Oct 09 '19 22:10 andreheringer

@andreheringer sorry man, I just saw this! Must've glossed over it in my email. Happy to accept PRs if you're interested in helping! I poke at it here and there :)

@sebasrivera96 -- thanks for helping out! Do you use Canteen?

jeffdn avatar Jan 13 '20 19:01 jeffdn