mirror of
https://github.com/rust-lang/cargo
synced 2024-08-28 03:39:31 +00:00
refactor(toml): Rely on resolved authors
This commit is contained in:
parent
425a8ae478
commit
00ba5780e4
|
@ -207,6 +207,10 @@ impl TomlPackage {
|
||||||
self.version.as_ref().map(|v| v.resolved()).transpose()
|
self.version.as_ref().map(|v| v.resolved()).transpose()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn resolved_authors(&self) -> Result<Option<&Vec<String>>, UnresolvedError> {
|
||||||
|
self.authors.as_ref().map(|v| v.resolved()).transpose()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn resolved_description(&self) -> Result<Option<&String>, UnresolvedError> {
|
pub fn resolved_description(&self) -> Result<Option<&String>, UnresolvedError> {
|
||||||
self.description.as_ref().map(|v| v.resolved()).transpose()
|
self.description.as_ref().map(|v| v.resolved()).transpose()
|
||||||
}
|
}
|
||||||
|
|
|
@ -562,6 +562,12 @@ pub fn to_real_manifest(
|
||||||
.map(|value| field_inherit_with(value, "version", || inherit()?.version()))
|
.map(|value| field_inherit_with(value, "version", || inherit()?.version()))
|
||||||
.transpose()?
|
.transpose()?
|
||||||
.map(manifest::InheritableField::Value);
|
.map(manifest::InheritableField::Value);
|
||||||
|
package.authors = package
|
||||||
|
.authors
|
||||||
|
.clone()
|
||||||
|
.map(|value| field_inherit_with(value, "authors", || inherit()?.authors()))
|
||||||
|
.transpose()?
|
||||||
|
.map(manifest::InheritableField::Value);
|
||||||
package.description = package
|
package.description = package
|
||||||
.description
|
.description
|
||||||
.clone()
|
.clone()
|
||||||
|
@ -940,10 +946,9 @@ pub fn to_real_manifest(
|
||||||
.expect("previously resolved")
|
.expect("previously resolved")
|
||||||
.cloned(),
|
.cloned(),
|
||||||
authors: package
|
authors: package
|
||||||
.authors
|
.resolved_authors()
|
||||||
.clone()
|
.expect("previously resolved")
|
||||||
.map(|mw| field_inherit_with(mw, "authors", || inherit()?.authors()))
|
.cloned()
|
||||||
.transpose()?
|
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
license: package
|
license: package
|
||||||
.resolved_license()
|
.resolved_license()
|
||||||
|
@ -976,10 +981,6 @@ pub fn to_real_manifest(
|
||||||
links: package.links.clone(),
|
links: package.links.clone(),
|
||||||
rust_version: rust_version.clone(),
|
rust_version: rust_version.clone(),
|
||||||
};
|
};
|
||||||
package.authors = package
|
|
||||||
.authors
|
|
||||||
.as_ref()
|
|
||||||
.map(|_| manifest::InheritableField::Value(metadata.authors.clone()));
|
|
||||||
package.exclude = package
|
package.exclude = package
|
||||||
.exclude
|
.exclude
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
|
Loading…
Reference in a new issue