DEV Community

Discussion on: Let's create a basic crud api with Rust using Tide

Collapse
wabiledev profile image
wabiledev

Hi,

thank you for tide based CRUD example. I have followed from the beginning and I am making progress.

I am struggling with the section "Nice! now let's try getting and individual dino...", the code does not compile with an error description:
Entry::Vacant(_entry) => Response::new(404),
| ^^^^^^^^^^^^^ not a tuple struct or tuple variant

I am not certain what to do to fix the error, though I recognise "Entry::C=Vacant(_entry)" as either a Rust enum or tuple construct.

Is there something I have missed?

Collapse
pepoviola profile image
Javier Viola Author

Hi wabiledev,
Thanks for reading this serie 😃. That part of the serie is before of the refactor and you can check in this tag (github.com/pepoviola/tide-basic-cr...).
I'm checking now and compiles and works as expected, but with an older version of tide (0.13) are you using the last one?

Thanks again for reading 🙌😃

Collapse
wabiledev profile image
wabiledev

Hi Javier,

I am using rust version 1.51 and Tide version 0.16.

I eventually managed to compile the code after importing the line "use std::collections::hash_map::Entry;".

Thank you

Thread Thread
pepoviola profile image
Javier Viola Author

Hi wabiledev,
Thanks! Yes, you need that import before use the Entry api. I will add a note into the post :) . Again thanks for reading this serie and help me to improve it.

Thanks!