Skip to content

Commit

Permalink
[lang] Fix bug that ret_ty in JSON API generation is nested
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbepop committed Mar 19, 2019
1 parent 45c3f21 commit 1e16239
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lang/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,15 @@ impl From<&hir::DeployHandler> for DeployDescription {

/// Describes the return type of a contract message.
#[derive(Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct ReturnTypeDescription {
/// The optional return type.
ret_ty: Option<TypeDescription>,
}
pub struct ReturnTypeDescription(Option<TypeDescription>);

impl ReturnTypeDescription {
/// Creates a new return type description from the given optional type.
pub fn new<T>(opt_type: T) -> Self
where
T: Into<Option<TypeDescription>>,
{
Self {
ret_ty: opt_type.into(),
}
Self(opt_type.into())
}
}

Expand Down

0 comments on commit 1e16239

Please sign in to comment.