mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
Set default for readme in Manifest if it's not specified.
If the readme field is not specified, assume a default of "README.md" (temporarily). Further, if the readme field is set to "false", then this defaulting behavior is suppressed.
This commit is contained in:
parent
13bded9a33
commit
b23390b27f
@ -1198,11 +1198,20 @@ impl TomlManifest {
|
||||
project.links.as_deref(),
|
||||
project.namespaced_features.unwrap_or(false),
|
||||
)?;
|
||||
|
||||
let readme = match &project.readme {
|
||||
None => Some(String::from("README.md")),
|
||||
Some(value) => match value.as_str() {
|
||||
"false" => None,
|
||||
_ => Some(value.clone())
|
||||
}
|
||||
};
|
||||
|
||||
let metadata = ManifestMetadata {
|
||||
description: project.description.clone(),
|
||||
homepage: project.homepage.clone(),
|
||||
documentation: project.documentation.clone(),
|
||||
readme: project.readme.clone(),
|
||||
readme,
|
||||
authors: project.authors.clone().unwrap_or_default(),
|
||||
license: project.license.clone(),
|
||||
license_file: project.license_file.clone(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user