Skip to content

Commit

Permalink
chore: remove duplicate linkage type
Browse files Browse the repository at this point in the history
  • Loading branch information
Gankra committed Mar 18, 2024
1 parent 62c009c commit 367059f
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 253 deletions.
17 changes: 17 additions & 0 deletions cargo-dist-schema/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,23 @@ impl Linkage {
}
}

impl Library {
/// Make a new Library with the given path and no source
pub fn new(path: String) -> Self {
Self { path, source: None }
}
}

impl std::fmt::Display for Library {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(package) = &self.source {
write!(f, "{} ({package})", self.path)
} else {
write!(f, "{}", self.path)
}
}
}

/// Helper to read the raw version from serialized json
fn dist_version(input: &str) -> Option<Version> {
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
Expand Down
2 changes: 1 addition & 1 deletion cargo-dist/src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl BuildExpectations {
});
linkage
} else {
determine_linkage(src_path, target)?.to_schema()
determine_linkage(src_path, target)?
};
let bin = dist.binary(src.idx);
manifest.assets.insert(
Expand Down
Loading

0 comments on commit 367059f

Please sign in to comment.