Skip to content

Commit ef05231

Browse files
committed
cargo: Remove duplicate Profile enum.
use the one from the configuration instead.
1 parent 0ba2414 commit ef05231

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

src/bindgen/cargo/cargo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ use crate::bindgen::cargo::cargo_lock::{self, Lock};
99
pub(crate) use crate::bindgen::cargo::cargo_metadata::PackageRef;
1010
use crate::bindgen::cargo::cargo_metadata::{self, Metadata};
1111
use crate::bindgen::cargo::cargo_toml;
12+
use crate::bindgen::config::Profile;
1213
use crate::bindgen::error::Error;
1314
use crate::bindgen::ir::Cfg;
14-
pub(crate) use cargo_expand::Profile;
1515

1616
/// Parse a dependency string used in Cargo.lock
1717
fn parse_dep_string(dep_string: &str) -> (&str, Option<&str>) {

src/bindgen/cargo/cargo_expand.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5+
use crate::bindgen::config::Profile;
56
use std::env;
67
use std::error;
78
use std::fmt;
@@ -24,14 +25,6 @@ pub enum Error {
2425
Compile(String),
2526
}
2627

27-
/// Which Cargo profile (group) to use when expanding macros.
28-
pub enum Profile {
29-
/// Do not pass `--release` when expanding macros
30-
Debug,
31-
/// Pass `--release` when expanding macros
32-
Release,
33-
}
34-
3528
impl From<io::Error> for Error {
3629
fn from(err: io::Error) -> Self {
3730
Error::Io(err)

src/bindgen/parser.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ use std::io::Read;
99
use std::path::{Path as FilePath, PathBuf as FilePathBuf};
1010

1111
use crate::bindgen::bitflags;
12-
use crate::bindgen::cargo;
1312
use crate::bindgen::cargo::{Cargo, PackageRef};
14-
use crate::bindgen::config::{Config, ParseConfig, Profile};
13+
use crate::bindgen::config::{Config, ParseConfig};
1514
use crate::bindgen::error::Error;
1615
use crate::bindgen::ir::{
1716
AnnotationSet, Cfg, Constant, Documentation, Enum, Function, GenericParams, ItemMap,
@@ -192,10 +191,7 @@ impl<'a> Parser<'a> {
192191
self.config.parse.expand.all_features,
193192
self.config.parse.expand.default_features,
194193
&self.config.parse.expand.features,
195-
match self.config.parse.expand.profile {
196-
Profile::Debug => cargo::Profile::Debug,
197-
Profile::Release => cargo::Profile::Release,
198-
},
194+
self.config.parse.expand.profile,
199195
)
200196
.map_err(|x| Error::CargoExpand(pkg.name.clone(), x))?;
201197
let i = syn::parse_file(&s).map_err(|x| Error::ParseSyntaxError {

0 commit comments

Comments
 (0)