Skip to content

Commit

Permalink
Fix punctuation
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichi committed Jan 24, 2023
1 parent 3edee36 commit 7b3d181
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions crates/env/src/chain_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ where
/// Declares a chain extension method with the unique ID of 5 that requires a `bool` and an `i32`
/// as input parameters and returns a `Result<i32, MyErrorCode>` upon completion,
/// because `handle_status` flag is set.
/// We still need to indicate that the original type is not `Result<T, E>`, so `const IS_RESULT` set `false`.
/// We still need to indicate that the original type is not `Result<T, E>`, so
/// `const IS_RESULT` is set `false`.
/// It will handle the shared error code from the chain extension.
/// The call is finally invoked with arguments `true` and `42` for the `bool` and `i32` input
/// parameter respectively.
Expand Down Expand Up @@ -411,7 +412,7 @@ where
/// # Example
///
/// Declares a chain extension method with the unique ID of 5 that requires a `bool` and an `i32`
/// as input parameters and returns a `i32` upon completion. Hence, `const IS_RESULT` set `false`.
/// as input parameters and returns a `i32` upon completion. Hence, `const IS_RESULT` is set `false`.
/// It will ignore the shared error code from the chain extension and assumes that the call succeeds.
/// The call is finally invoked with arguments `true` and `42` for the `bool` and `i32` input
/// parameter respectively.
Expand Down Expand Up @@ -444,7 +445,7 @@ where
}
}

/// Extract `Ok` and `Err` variants from `Result` type
/// Extract `Ok` and `Err` variants from `Result` type.
pub trait IsResultType: private::IsResultTypeSealed {
/// The `T` type of the `Result<T, E>`.
type Ok;
Expand Down
6 changes: 3 additions & 3 deletions crates/ink/src/chain_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ impl<T, E> IsResultType for Result<T, E> {
type Err = E;
}

/// Only implemented for [`ValueReturned`]
/// Only implemented for [`ValueReturned`].
///
/// Used to deduce the correct return type of a chain extension method at compile time
/// based on 2 flags: `const IS_RESULT: bool` and `const HANDLE_STATUS: bool`.
///
/// If `IS_RESULT` is set to `false` and `HANDLE_STATUS` is true, `type ReturnType = Result<T, E>`,
/// otherwise it is `ReturnType = T`
/// If `IS_RESULT` is set to `false` and `HANDLE_STATUS` is `true`, then
/// `type ReturnType = Result<T, E>`. Otherwise `type ReturnType = T`.
pub trait Output<const IS_RESULT: bool, const HANDLE_STATUS: bool, T, E>:
private::OutputSealed
{
Expand Down

0 comments on commit 7b3d181

Please sign in to comment.