Skip to content

Commit

Permalink
Add version vs. discriminator docs section (#6466)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaput authored Oct 9, 2024
1 parent bfe9ba6 commit 2451d4f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crates/cairo-lang-filesystem/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,22 @@ impl CrateConfiguration {
}
}

/// Same as `CrateConfiguration` but without the root directory..
/// Same as `CrateConfiguration` but without the root directory.
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct CrateSettings {
/// The crate's Cairo edition.
pub edition: Edition,
/// The crate's version.
///
/// ## [CrateSettings.version] vs. [DependencySettings.discriminator]
///
/// Cairo uses semantic versioning for crates.
/// The version field is an optional piece of metadata that can be attached to a crate
/// and is used in various lints and can be used as a context in diagnostics.
///
/// On the other hand, the discriminator is a unique identifier that allows including multiple
/// copies of a crate in a single compilation unit.
/// It is free-form and never reaches the user.
pub version: Option<Version>,
/// The `#[cfg(...)]` configuration.
pub cfg_set: Option<CfgSet>,
Expand Down

0 comments on commit 2451d4f

Please sign in to comment.