Skip to content

Commit 7a948aa

Browse files
committed
Don't read Cargo.toml.orig
Cargo won't use it, so neither should docs.rs. It's purely informative for people reading source code.
1 parent dfe6093 commit 7a948aa

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

crates/metadata/lib.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,14 @@ pub struct BuildTargets<'a> {
166166
impl Metadata {
167167
/// Read the `Cargo.toml` from a source directory, then parse the build metadata.
168168
///
169-
/// If both `Cargo.toml` and `Cargo.toml.orig` exist in the directory,
170-
/// `Cargo.toml.orig` will take precedence.
171-
///
172169
/// If you already have the path to a TOML file, use [`Metadata::from_manifest`] instead.
173170
pub fn from_crate_root<P: AsRef<Path>>(source_dir: P) -> Result<Metadata, MetadataError> {
174-
let source_dir = source_dir.as_ref();
175-
for &c in &["Cargo.toml.orig", "Cargo.toml"] {
176-
let manifest_path = source_dir.join(c);
177-
if manifest_path.exists() {
178-
return Metadata::from_manifest(manifest_path);
179-
}
171+
let manifest_path = source_dir.as_ref().join("Cargo.toml");
172+
if manifest_path.exists() {
173+
Metadata::from_manifest(manifest_path)
174+
} else {
175+
Err(io::Error::new(io::ErrorKind::NotFound, "no Cargo.toml").into())
180176
}
181-
182-
Err(io::Error::new(io::ErrorKind::NotFound, "no Cargo.toml").into())
183177
}
184178

185179
/// Read the given file into a string, then parse the build metadata.

0 commit comments

Comments
 (0)