"Effective Rust", item 24

⚓ Rust    📅 2026-03-22    👤 surdeus    👁️ 2      

surdeus

Info

This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: "Effective Rust", item 24

I do not really understand the following section:

As an aside, think carefully before using another crate's types in your API: it intimately ties your crate to that of the dependency. For example, a major version bump for the dependency (Item 21) will automatically require a major version bump for your crate too.

from Item 24: Re-export dependencies whose types appear in your API - Effective Rust

My problem is the "will automatically". Obviously, when my API uses a foreign data type, and that type's internal public structure changes for a mayor update of that crate, I might get a problem. But when that type does not change at all, or only the private internal structure changes, why should my crate and the users of my crate care, and why would my crate then require a major version bump?

2 posts - 2 participants

Read full topic

🏷️ Rust_feed