Skip to content

Commit

Permalink
Merge pull request #879 from EPashkin/fix_signal_doc
Browse files Browse the repository at this point in the history
Fix signal doc
  • Loading branch information
EPashkin committed Dec 15, 2019
2 parents 894f9e5 + ac6f87a commit d1e88f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/codegen/doc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ fn create_object_doc(w: &mut dyn Write, env: &Env, info: &analysis::object::Info
.iter()
.filter_map(|f| f.rename.as_ref())
.next()
.unwrap_or_else(|| &function.name);
create_fn_doc(w, env, function, Some(Box::new(ty)), &fn_name)?;
.cloned();
create_fn_doc(w, env, function, Some(Box::new(ty)), fn_name)?;
}
for signal in signals {
let ty = if has_trait {
Expand All @@ -292,7 +292,7 @@ fn create_object_doc(w: &mut dyn Write, env: &Env, info: &analysis::object::Info
} else {
ty.clone()
};
create_fn_doc(w, env, signal, Some(Box::new(ty)), &signal.name)?;
create_fn_doc(w, env, signal, Some(Box::new(ty)), None)?;
}
for property in properties {
let ty = if has_trait {
Expand Down Expand Up @@ -345,7 +345,7 @@ fn create_record_doc(w: &mut dyn Write, env: &Env, info: &analysis::record::Info
..ty
};
for function in &record.functions {
create_fn_doc(w, env, function, Some(Box::new(ty.clone())), &function.name)?;
create_fn_doc(w, env, function, Some(Box::new(ty.clone())), None)?;
}
Ok(())
}
Expand Down Expand Up @@ -414,7 +414,7 @@ fn create_fn_doc<T>(
env: &Env,
fn_: &T,
parent: Option<Box<TypeStruct>>,
fn_name: &str,
name_override: Option<String>,
) -> Result<()>
where
T: FunctionLikeType + ToStripperType,
Expand All @@ -432,8 +432,8 @@ where

let symbols = env.symbols.borrow();
let mut st = fn_.to_stripper_type();
if st.name != fn_name {
st.name = fn_name.to_owned();
if let Some(name_override) = name_override {
st.name = name_override;
}
let ty = TypeStruct { parent, ..st };
let self_name: Option<String> = fn_
Expand Down
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl Library {
elem: &Element,
) -> Result<(), String> {
if let Some(typ) = self.read_record(parser, ns_id, elem, None, None)? {
let name = typ.get_name().clone();
let name = typ.get_name();
self.add_type(ns_id, &name, typ);
}
Ok(())
Expand Down

0 comments on commit d1e88f9

Please sign in to comment.