Feedback API server with post request, integration test, load testing

Hi !

I would first like to thank the rust community. I wanted to make my first project completely in rust as part of a test. You have always been kind and available.

Today, I share my work with you.

As part of a technical test (with the language I want to use), I had to implement an API and tests but no database (only to save in memory).
Although the technical test has passed, I would like to improve my code and documentation to make it more in the style of rust and more professional. This development was very stimulating. I hope it can also help some people if needed.

Here my repo : GitHub - tooremdrama/promocode: Promocode is a API server to deal with promo code.

If you have any feedback, thank you.

1 Like

Great and simple, i've seen ACCEPTED and DENIED somewhere it would be better if you turned those into enums, you should also exploit the use of references which corresponds to the use of lifetimes too, to reduce the amount of clones, use Result and Option, in the whooole project there are like 3 Results and Options,
I have two questions, from which language did you come from?
And did you perhaps use Ai to write docs and some functions? Because i really hate ai, i don't wanna go on a rant but using Ai is literally coding in english(i don't think you really used ai but your code looks inconsistent).
God i hate ai.
<3

1 Like

Explore the use of structs too, use serde, properly handle errors

1 Like

Thank you very much for your time.
About the use of lifetime, I had compilation problem because of the macro #[derive(Object)]... but yes I would like to use it too.
I will take your return.

I do not use any AI for my code. Never. I read documentation or forum resolved problem...
I am french, so to speak english I use sometimes google traduction.
For this post I don’t for this example...
And I like using vim...

1 Like

Love it great, i've seen you asking, this forum needs more energetic people like you, and french is my second language too btw.
Keep going fellow vimmer

1 Like