Fix mistakes/nits.

This commit is contained in:
Richard Dodd 2018-07-25 18:08:57 +01:00
parent ba67089501
commit 66bc98cc4b
2 changed files with 10 additions and 5 deletions

View File

@ -36,16 +36,20 @@ pub struct Export {
pub constructor: Option<String>, pub constructor: Option<String>,
/// The rust function /// The rust function
pub function: Function, pub function: Function,
/// /// Comments extracted from the rust source.
pub comments: Vec<String>, pub comments: Vec<String>,
/// The name of the rust object the function belongs to TODO is this correct? /// The name of the rust function/method on the rust side.
pub rust_name: Ident, pub rust_name: Ident,
} }
/// The 3 types variations of `self`.
#[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] #[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))]
pub enum MethodSelf { pub enum MethodSelf {
/// `self`
ByValue, ByValue,
/// `&mut self`
RefMutable, RefMutable,
/// `&self`
RefShared, RefShared,
} }
@ -251,7 +255,9 @@ impl Export {
Ident::new(&generated_name, Span::call_site()) Ident::new(&generated_name, Span::call_site())
} }
/// ??? /// This is the name of the shim function that gets exported and takes the raw
/// ABI form of its arguments and converts them back into their normal,
/// "high level" form before calling the actual function.
pub(crate) fn export_name(&self) -> String { pub(crate) fn export_name(&self) -> String {
let fn_name = self.function.name.to_string(); let fn_name = self.function.name.to_string();
match &self.class { match &self.class {
@ -277,7 +283,6 @@ impl Export {
} }
} }
impl Enum { impl Enum {
fn shared(&self) -> shared::Enum { fn shared(&self) -> shared::Enum {
shared::Enum { shared::Enum {

View File

@ -48,7 +48,7 @@ impl BindgenAttrs {
.next() .next()
} }
/// Get the first module attribute /// Get the first version attribute
fn version(&self) -> Option<&str> { fn version(&self) -> Option<&str> {
self.attrs self.attrs
.iter() .iter()