1 hour ago · 7 min read1348 words · Tech · hide · 0 comments

An alert lands. You were eight hours intensely into something completely unrelated to that alert. You have this alert now, and you are not just tired. You are spent. The log says the sequencer failed. You open the crate that returns EngineError. You search for EngineError::Sequencer. Zero call sites. The conversion happened. The compiler was happy. You are not. The ? that made some method in that engine code look clean is the line that hides what you cannot find when the unexpected alert hits you right after you emptied the tank on a problem that had nothing to do with this matching engine. Many things push you to use it. From is idiomatic. The book teaches it, and thiserror will derive it for you if you put #[from] on a variant. Then ? does what people hired Rust for: in the most compact way for the codebase, the inner error becomes the outer error and the function body stays a list of happy-path calls. The ecosystem rewards this. Less typing. One impl From per variant, generated,…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.