To all people, who think #Rust's syntax is ugly: maybe you should give this one a read:
Complexity Has to Live Somewhere - by Fred Hebert (discovered through @algo_luca's #Zero2Prod book):
https://ferd.ca/complexity-has-to-live-somewhere.html
"If you're unlucky and you just tried to pretend complexity could be avoided altogether, it has no place to go in this world. But it still doesn't stop existing."
#Rust #Zero2Prod #rustlang #complexity #softwareDevelopment
So I'm going through zero2prod rust book.
And doing each code block in both actix-web and axum at the same time.
I have to say that I'm having a blast with axum, even though the book's codes are for actix-web.
Axum seems to be trying extremely hard to get out of the way, and rely much more on the ecosystem, rather than trying to have a full framework with all the custom pieces and custom batteries included in the packaging.
#rust #rustlang #actix #Axum #Zero2Prod
Running integration tests on a web service in parallel requires spawning it multiple times. You have to make sure you use a free port each time. I didn't know that std::net::TcpListener::bind("127.0.0.1:0") does assign a free port, that you can query on the return value. From a book that I received as a present: "Zero to Production in Rust". I like it!
In the documentation it is mentioned that ":0" assigns a port, but it wasn't clear to me that it is an unused port.