Improving Pair construction.
diff --git a/syntax/impls.rs b/syntax/impls.rs
index 92c804a..f4c5b05 100644
--- a/syntax/impls.rs
+++ b/syntax/impls.rs
@@ -300,14 +300,22 @@
impl Pair {
/// Use this constructor when the item can't have a different
- /// name in Rust and C++. For cases where #[rust_name] and similar
- /// attributes can be used, construct the object by hand.
+ /// name in Rust and C++.
pub fn new(ns: Namespace, ident: Ident) -> Self {
Self {
rust: ident.clone(),
cxx: CppName::new(ns, ident),
}
}
+
+ /// Use this constructor when attributes such as #[rust_name]
+ /// can be used to potentially give a different name in Rust vs C++.
+ pub fn new_from_differing_names(ns: Namespace, cxx_ident: Ident, rust_ident: Ident) -> Self {
+ Self {
+ rust: rust_ident,
+ cxx: CppName::new(ns, cxx_ident),
+ }
+ }
}
impl ResolvableName {