Let the compiler check your URLs 0 ▲ Guilherme Souza 1 day ago · Tech · hide · 0 comments It's nice when some classes of bugs cannot be fabricated. For example, some languages like Kotlin and Rust bake the concept of "empty" especially in the language and standard library to remind and force you (the developer) to deal with the case when something is missing. This post is about a library I wrote that brings a similar compile-verified assurance to URL construction when writing web servers in Rust. 🦀 The problem it solves is: in a web server, you usually declare some "handlers" (like web pages, assets or api endpoints) and hook them to a global path router. It works well, but what about when you want to link from one page to another? How to do that correctly and let the compiler help you keep all links correct as your app evolves? To illustrate, consider this basic example using the library axum in Rust to create a website with a home page and a dynamic "posts" page, with the home linking to a post: use axum::extract::Path; use axum::response::Html; use axum::routing::get;… No comments yet. Log in to reply on the Fediverse. Comments will appear here.