Some(first_seg_str + &remaining)
} else if first_seg_str == "crate" {
Some(self.crate_name.to_owned() + &remaining)
+ } else if self.library.modules.get(&format!("{}::{}", self.module_path, first_seg.ident)).is_some() {
+ Some(format!("{}::{}{}", self.module_path, first_seg.ident, remaining))
} else { None }
}
}
fn empty_val_check_suffix_from_path(&self, full_path: &str) -> Option<&str> {
match full_path {
"secp256k1::PublicKey"|"bitcoin::secp256k1::PublicKey" => Some(".is_null()"),
- "bitcoin::secp256k1::ecdsa::Signature" => Some(".is_null()"),
_ => None
}
}
// If this is a no-export'd crate and there's only one implementation in the
// whole crate, just treat it as a reference to whatever the implementor is.
if with_ref_lifetime {
- write!(w, "&'static crate::{}", trait_impls[0]).unwrap();
+ // Hope we're being printed in function generics and let rustc derive the
+ // type.
+ write!(w, "_").unwrap();
} else {
write!(w, "&crate::{}", trait_impls[0]).unwrap();
}