Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard and core library inline documentation #4830

Merged
merged 42 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ba81361
Vec.sw documentation (#4816)
SwayStar123 Jul 19, 2023
01c693b
Merge branch 'master' into standard-documentation
SwayStar123 Jul 19, 2023
c9aa943
U256 documentation (#4831)
SwayStar123 Jul 19, 2023
ac96b56
U128 documentation (#4833)
SwayStar123 Jul 19, 2023
1b0f4c2
Update all storage inline docs to follow SRC-2 standard (#4836)
bitzoic Jul 20, 2023
b62d604
Token library documentation (#4834)
SwayStar123 Jul 20, 2023
7b8ca4b
Update memory manipulation libs to meet SRC-2 inline docs standard (#…
bitzoic Jul 22, 2023
6520b42
Update assertion and results to meet SRC-2 inline docs standard (#4846)
bitzoic Jul 22, 2023
8a51f03
string documentation (#4835)
SwayStar123 Jul 24, 2023
165c1b6
A-B library documentation (#4848)
SwayStar123 Jul 24, 2023
2dd2072
Updates to storage docs to meet SRC-2 inline docs standard (#4864)
bitzoic Jul 27, 2023
2a4f6fb
Update inline docs of address, contract id, and identity to meet SRC-…
bitzoic Jul 27, 2023
ad23dea
Std-lib external, call_frames, and context inline docs updates to mee…
bitzoic Jul 27, 2023
48cd9dd
copied rust docs to sway (#4880)
SwayStar123 Jul 29, 2023
4ddf194
Input intrinsics (#4891)
SwayStar123 Aug 3, 2023
15abfb4
Update flags and constants docs (#4881)
SwayStar123 Aug 4, 2023
4b86d73
Merge branch 'master' into standard-documentation
bitzoic Aug 4, 2023
03c69a9
Fix merge errors
bitzoic Aug 4, 2023
6e6aa94
tx docs (#4914)
SwayStar123 Aug 4, 2023
43e71cb
Llc outputs error_signals (#4906)
SwayStar123 Aug 5, 2023
3462264
Update std-lib cryptographic functions to meet SRC-2 inline docs stan…
bitzoic Aug 5, 2023
33f17e7
Update sway-lib-core to meet SRC-2 inline docs standard (#4882)
bitzoic Aug 5, 2023
0bcc0f0
Update registers.sw to meet SRC-2 inline docs standard (#4920)
bitzoic Aug 7, 2023
918674d
Merge branch 'master' into standard-documentation
SwayStar123 Aug 7, 2023
feed00e
Update sway-lib-std/src/option.sw
SwayStar123 Aug 8, 2023
a6a86d4
Merge branch 'master' into standard-documentation
SwayStar123 Aug 8, 2023
e905f34
add back doc line
SwayStar123 Aug 8, 2023
17d6cf8
change panic to revert
SwayStar123 Aug 10, 2023
bfa4346
Merge branch 'master' into standard-documentation
SwayStar123 Aug 10, 2023
b6501c3
Updates to sway-lib-core based on PR review comments
bitzoic Aug 14, 2023
15a9494
More core changes
bitzoic Aug 14, 2023
c089291
Update sway-lib-core based on PR review comments
bitzoic Aug 14, 2023
47b8185
Merge branch 'master' into standard-documentation
bitzoic Aug 15, 2023
38d3ebf
Fix LSP CI
bitzoic Aug 15, 2023
2e2a4a2
Fix LSP CI 2
bitzoic Aug 15, 2023
b07a4c7
Fix LSP CI 3
bitzoic Aug 15, 2023
d97f650
Final PR review comments
bitzoic Aug 16, 2023
1cc37fb
Merge branch 'master' into standard-documentation
bitzoic Aug 16, 2023
28e7464
Merge branch 'master' into standard-documentation
SwayStar123 Aug 16, 2023
5108a4e
Merge branch 'master' into standard-documentation
JoshuaBatty Aug 21, 2023
124c184
Merge branch 'master' into standard-documentation
bitzoic Aug 21, 2023
582b764
Merge branch 'master' into standard-documentation
JoshuaBatty Aug 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 40 additions & 40 deletions sway-lib-core/src/ops.sw
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub trait Add {
///
/// # Arguments
///
/// * `other`: [Self] - The value to add of the same type.
/// * `other`: [Self] - The value to add to self.
///
/// # Returns
///
Expand All @@ -23,9 +23,9 @@ pub trait Add {
///
/// impl Add for MyStruct {
/// fn add(self, other: Self) -> Self {
/// let result = self.val + other.val;
/// let val = self.val + other.val;
/// Self {
/// val: result
/// val
/// }
/// }
/// }
Expand Down Expand Up @@ -96,7 +96,7 @@ pub trait Subtract {
///
/// # Arguments
///
/// * `other`: [Self] - The value to subtract of the same type.
/// * `other`: [Self] - The value to subtract from self.
///
/// # Returns
///
Expand All @@ -111,9 +111,9 @@ pub trait Subtract {
///
/// impl Subtract for MyStruct {
/// fn subtract(self, other: Self) -> Self {
/// let result = self.val - other.val;
/// let val = self.val - other.val;
/// Self {
/// val: result
/// val
/// }
/// }
/// }
Expand Down Expand Up @@ -166,7 +166,7 @@ pub trait Multiply {
///
/// # Arguments
///
/// * `other`: [Self] - The value to multiply of the same type.
/// * `other`: [Self] - The value to multiply with self.
///
/// # Returns
///
Expand All @@ -181,9 +181,9 @@ pub trait Multiply {
///
/// impl Multiply for MyStruct {
/// fn multiply(self, other: Self) -> Self {
/// let result = self.val * other.val;
/// let val = self.val * other.val;
/// Self {
/// val: result
/// val
/// }
/// }
/// }
Expand Down Expand Up @@ -254,7 +254,7 @@ pub trait Divide {
///
/// # Arguments
///
/// * `other`: [Self] - The value to divide of the same type.
/// * `other`: [Self] - The value to divide with self.
///
/// # Returns
///
Expand All @@ -269,9 +269,9 @@ pub trait Divide {
///
/// impl Divide for MyStruct {
/// fn divide(self, other: Self) -> Self {
/// let result = self.val / other.val;
/// let val = self.val / other.val;
/// Self {
/// val: result
/// val
/// }
/// }
/// }
Expand Down Expand Up @@ -326,7 +326,7 @@ pub trait Mod {
///
/// # Arguments
///
/// * `other`: [Self] - The value to mod of the same type.
/// * `other`: [Self] - The value to mod with self.
///
/// # Returns
///
Expand All @@ -341,9 +341,9 @@ pub trait Mod {
///
/// impl Mod for MyStruct {
/// fn modulo(self, other: Self) -> Self {
/// let result = self.val % other.val;
/// let val = self.val % other.val;
/// Self {
/// val: result
/// val
/// }
/// }
/// }
Expand Down Expand Up @@ -414,7 +414,7 @@ pub trait Not {
/// fn foo() {
/// let struct = MyStruct { val: true };
/// let result_struct = !struct;
/// assert(result_struct.val == false);
/// assert(!result_struct.val);
/// }
/// ```
fn not(self) -> Self;
Expand Down Expand Up @@ -453,15 +453,15 @@ pub trait Eq {
///
/// impl Eq for MyStruct {
/// fn eq(self, other: Self) -> bool {
/// self.val == other.val;
/// self.val == other.val
/// }
/// }
///
/// fn foo() {
/// let struct1 = MyStruct { val: 2 };
/// let struct2 = MyStruct { val: 2 };
/// let result = struct1 == struct2;
/// assert(result == true);
/// assert(result);
/// }
/// ```
fn eq(self, other: Self) -> bool;
Expand Down Expand Up @@ -489,15 +489,15 @@ pub trait Eq {
///
/// impl Eq for MyStruct {
/// fn eq(self, other: Self) -> bool {
/// self.val == other.val;
/// self.val == other.val
/// }
/// }
///
/// fn foo() {
/// let struct1 = MyStruct { val: 10 };
/// let struct2 = MyStruct { val: 2 };
/// let result = struct1 != struct2;
/// assert(result == true);
/// assert(result);
/// }
/// ```
fn neq(self, other: Self) -> bool {
Expand Down Expand Up @@ -579,15 +579,15 @@ pub trait Ord {
///
/// impl Ord for MyStruct {
/// fn gt(self, other: Self) -> bool {
/// self.val > other.val;
/// self.val > other.val
/// }
/// }
///
/// fn foo() {
/// let struct1 = MyStruct { val: 10 };
/// let struct2 = MyStruct { val: 2 };
/// let result = struct1 > struct2;
/// assert(result == true);
/// assert(result);
/// }
/// ```
fn gt(self, other: Self) -> bool;
Expand All @@ -611,15 +611,15 @@ pub trait Ord {
///
/// impl Ord for MyStruct {
/// fn lt(self, other: Self) -> bool {
/// self.val < other.val;
/// self.val < other.val
/// }
/// }
///
/// fn foo() {
/// let struct1 = MyStruct { val: 10 };
/// let struct2 = MyStruct { val: 2 };
/// let result = struct1 < struct2;
/// assert(result == false);
/// assert(!result);
/// }
/// ```
fn lt(self, other: Self) -> bool;
Expand Down Expand Up @@ -718,9 +718,9 @@ pub trait BitwiseAnd {
///
/// impl BitwiseAnd for MyStruct {
/// fn binary_and(self, other: Self) -> Self {
/// let result = self.val & other.val;
/// let val = self.val & other.val;
/// Self {
/// val: result
/// val
/// }
/// }
/// }
Expand Down Expand Up @@ -780,9 +780,9 @@ pub trait BitwiseOr {
///
/// impl BitwiseOr for MyStruct {
/// fn binary_or(self, other: Self) -> Self {
/// let result = self.val | other.val;
/// let val = self.val | other.val;
/// Self {
/// val: result
/// val
/// }
/// }
/// }
Expand Down Expand Up @@ -842,9 +842,9 @@ pub trait BitwiseXor {
///
/// impl BitwiseXOr for MyStruct {
/// fn binary_xor(self, other: Self) -> Self {
/// let result = self.val ^ other.val;
/// let val = self.val ^ other.val;
/// Self {
/// val: result
/// val
/// }
/// }
/// }
Expand Down Expand Up @@ -975,13 +975,13 @@ trait OrdEq: Ord + Eq {
///
/// impl Eq for MyStruct {
/// fn eq(self, other: Self) -> bool {
/// self.val == other.val;
/// self.val == other.val
/// }
/// }
///
/// impl Ord for MyStruct {
/// fn gt(self, other: Self) -> bool {
/// self.val > other.val;
/// self.val > other.val
/// }
/// }
///
Expand All @@ -991,7 +991,7 @@ trait OrdEq: Ord + Eq {
/// let struct1 = MyStruct { val: 10 };
/// let struct2 = MyStruct { val: 10 };
/// let result = struct1 >= struct2;
/// assert(result == true);
/// assert(result);
/// }
/// ```
fn ge(self, other: Self) -> bool {
Expand Down Expand Up @@ -1021,13 +1021,13 @@ trait OrdEq: Ord + Eq {
///
/// impl Eq for MyStruct {
/// fn eq(self, other: Self) -> bool {
/// self.val == other.val;
/// self.val == other.val
/// }
/// }
///
/// impl Ord for MyStruct {
/// fn lt(self, other: Self) -> bool {
/// self.val < other.val;
/// self.val < other.val
/// }
/// }
///
Expand All @@ -1037,7 +1037,7 @@ trait OrdEq: Ord + Eq {
/// let struct1 = MyStruct { val: 10 };
/// let struct2 = MyStruct { val: 10 };
/// let result = struct1 <= struct2;
/// assert(result == true);
/// assert(result);
/// }
/// ```
fn le(self, other: Self) -> bool {
Expand Down Expand Up @@ -1072,9 +1072,9 @@ pub trait Shift {
///
/// impl Shift for MyStruct {
/// fn lsh(self, other: u64) -> Self {
/// let result = self.val << other;
/// let val = self.val << other;
/// Self {
/// val: result
/// val
/// }
/// }
/// }
Expand Down Expand Up @@ -1106,9 +1106,9 @@ pub trait Shift {
///
/// impl Shift for MyStruct {
/// fn rsh(self, other: u64) -> Self {
/// let result = self.val >> other;
/// let val = self.val >> other;
/// Self {
/// val: result
/// val
/// }
/// }
/// }
Expand Down
Loading