File tree 1 file changed +5
-11
lines changed
1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -166,20 +166,14 @@ pub struct BuildTargets<'a> {
166
166
impl Metadata {
167
167
/// Read the `Cargo.toml` from a source directory, then parse the build metadata.
168
168
///
169
- /// If both `Cargo.toml` and `Cargo.toml.orig` exist in the directory,
170
- /// `Cargo.toml.orig` will take precedence.
171
- ///
172
169
/// If you already have the path to a TOML file, use [`Metadata::from_manifest`] instead.
173
170
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 ( ) )
180
176
}
181
-
182
- Err ( io:: Error :: new ( io:: ErrorKind :: NotFound , "no Cargo.toml" ) . into ( ) )
183
177
}
184
178
185
179
/// Read the given file into a string, then parse the build metadata.
You can’t perform that action at this time.
0 commit comments