If you use mostly free functions things will shake out naturally, if you use lots of dynamic dispatch you'll pull in stuff that doesn't get called.
If that does become a problem, there are also techniques like https://github.com/rust-lang/rust/issues/68262 too.