Skip to content

Commit

Permalink
move slice, ops, primitves
Browse files Browse the repository at this point in the history
  • Loading branch information
SwayStar123 committed Nov 18, 2024
1 parent 6a14300 commit f954429
Show file tree
Hide file tree
Showing 20 changed files with 1,910 additions and 1,923 deletions.
1,431 changes: 0 additions & 1,431 deletions sway-lib-core/src/ops.sw

Large diffs are not rendered by default.

450 changes: 0 additions & 450 deletions sway-lib-core/src/primitives.sw

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions sway-lib-core/src/slice.sw
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
library;

use ::raw_ptr::*;

impl<T> &__slice[T] {
pub fn ptr(self) -> raw_ptr {
let (ptr, _) = asm(s: self) {
s: (raw_ptr, u64)
};
ptr
}

pub fn len(self) -> u64 {
let (_, len) = asm(s: self) {
s: (raw_ptr, u64)
};
len
}
}
2 changes: 1 addition & 1 deletion sway-lib-std/src/address.sw
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl Address {
}
}

impl core::ops::Eq for Address {
impl ::ops::Eq for Address {
fn eq(self, other: Self) -> bool {
self.bits == other.bits
}
Expand Down
2 changes: 1 addition & 1 deletion sway-lib-std/src/asset_id.sw
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Hash for AssetId {
}
}

impl core::ops::Eq for AssetId {
impl ::ops::Eq for AssetId {
fn eq(self, other: Self) -> bool {
self.bits == other.bits
}
Expand Down
2 changes: 1 addition & 1 deletion sway-lib-std/src/b512.sw
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct B512 {
bits: [b256; 2],
}

impl core::ops::Eq for B512 {
impl ::ops::Eq for B512 {
fn eq(self, other: Self) -> bool {
(self.bits)[0] == (other.bits)[0] && (self.bits)[1] == (other.bits)[1]
}
Expand Down
2 changes: 1 addition & 1 deletion sway-lib-std/src/bytes.sw
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ impl Bytes {
}
}

impl core::ops::Eq for Bytes {
impl ::ops::Eq for Bytes {
fn eq(self, other: Self) -> bool {
if self.len != other.len {
return false;
Expand Down
2 changes: 1 addition & 1 deletion sway-lib-std/src/contract_id.sw
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl ContractId {
}
}

impl core::ops::Eq for ContractId {
impl ::ops::Eq for ContractId {
fn eq(self, other: Self) -> bool {
self.bits == other.bits
}
Expand Down
2 changes: 1 addition & 1 deletion sway-lib-std/src/identity.sw
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub enum Identity {
}
// ANCHOR_END: docs_identity

impl core::ops::Eq for Identity {
impl ::ops::Eq for Identity {
fn eq(self, other: Self) -> bool {
match (self, other) {
(Identity::Address(addr1), Identity::Address(addr2)) => addr1 == addr2,
Expand Down
2 changes: 1 addition & 1 deletion sway-lib-std/src/inputs.sw
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use ::tx::{
Transaction,
tx_type,
};
use core::ops::Eq;
use ::ops::Eq;
use ::revert::revert;

// GTF Opcode const selectors
Expand Down
3 changes: 3 additions & 0 deletions sway-lib-std/src/lib.sw
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ library;

pub mod raw_ptr;
pub mod raw_slice;
pub mod primitives;
pub mod slice;
pub mod constants;
pub mod error_signals;
pub mod logging;
Expand All @@ -17,6 +19,7 @@ pub mod iterator;
pub mod vec;
pub mod bytes;
pub mod flags;
pub mod ops;
pub mod math;
pub mod u128;
pub mod b512;
Expand Down
Loading

0 comments on commit f954429

Please sign in to comment.