A common pattern in Rust unit tests looks like this: You have a small function that calls the filesystem, a clock, a socket, an FFI function, or some other dependency. The production code is simple. Then you try to unit test an error path.

Source: [Dev.to](https://dev.to/xtsoftwarelabs/testing-rust-code-without-adding-test-only-traits-1h2f)

Sponsored