Skip to content

Commit

Permalink
Merge branch 'master' into jjcnn/name_clash_struct_def_glob_import
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcnn authored Jun 11, 2024
2 parents 13a2f9a + ba0d2d7 commit 0fbdb27
Show file tree
Hide file tree
Showing 242 changed files with 11,162 additions and 4,630 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ jobs:
- name: Install Forc
run: cargo install --locked --debug --path ./forc
- name: Run Unit Tests
run: forc build --path sway-lib-core && forc test --path sway-lib-core && forc build --path sway-lib-std && forc test --path sway-lib-std
run: forc build --path sway-lib-core && forc test --path sway-lib-core && forc build --path sway-lib-std && forc test --path sway-lib-std && forc build --path test/src/in_language_tests & forc test --path test/src/in_language_tests

forc-pkg-fuels-deps-check:
runs-on: ubuntu-latest
Expand Down
61 changes: 0 additions & 61 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions docs/book/src/basics/converting_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ Below are some common type conversions in Sway:

### Convert `str` to `str[]`

```sway
{{#include ../../../../examples/converting_types/src/strings.sw:strings_import}}
```

```sway
{{#include ../../../../examples/converting_types/src/strings.sw:str_to_str_array}}
```
Expand All @@ -61,40 +57,24 @@ Below are some common type conversions in Sway:

### Convert to `u64`

```sway
{{#include ../../../../examples/converting_types/src/to_u64.sw:to_u64_import}}
```

```sway
{{#include ../../../../examples/converting_types/src/to_u64.sw:to_u64}}
```

### Convert to `u32`

```sway
{{#include ../../../../examples/converting_types/src/to_u32.sw:to_u32_import}}
```

```sway
{{#include ../../../../examples/converting_types/src/to_u32.sw:to_u32}}
```

### Convert to `u16`

```sway
{{#include ../../../../examples/converting_types/src/to_u16.sw:to_u16_import}}
```

```sway
{{#include ../../../../examples/converting_types/src/to_u16.sw:to_u16}}
```

### Convert to `u8`

```sway
{{#include ../../../../examples/converting_types/src/to_u8.sw:to_u8_import}}
```

```sway
{{#include ../../../../examples/converting_types/src/to_u8.sw:to_u8}}
```
Expand Down
5 changes: 0 additions & 5 deletions examples/converting_types/src/strings.sw
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
library;

// ANCHOR: strings_import
use std::primitive_conversions::str::*;
// ANCHOR_END: strings_import


pub fn convert_str_to_str_array() {
// ANCHOR: str_to_str_array
let fuel_str: str = "fuel";
Expand Down
4 changes: 0 additions & 4 deletions examples/converting_types/src/to_u16.sw
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
library;

// ANCHOR: to_u16_import
use std::{primitive_conversions::{u16::*, u32::*, u64::*,},};
// ANCHOR_END: to_u16_import

pub fn convert_uint_to_u16() {
// Convert any unsigned integer to `u16`
// ANCHOR: to_u16
Expand Down
4 changes: 0 additions & 4 deletions examples/converting_types/src/to_u32.sw
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
library;

// ANCHOR: to_u32_import
use std::{primitive_conversions::{u32::*, u64::*,},};
// ANCHOR_END: to_u32_import

pub fn convert_uint_to_u32() {
// Convert any unsigned integer to `u32`
// ANCHOR: to_u32
Expand Down
4 changes: 0 additions & 4 deletions examples/converting_types/src/to_u64.sw
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
library;

// ANCHOR: to_u64_import
use std::primitive_conversions::u64::*;
// ANCHOR_END: to_u64_import

pub fn convert_uint_to_u64() {
// Convert any unsigned integer to `u64`
// ANCHOR: to_u64
Expand Down
4 changes: 0 additions & 4 deletions examples/converting_types/src/to_u8.sw
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
library;

// ANCHOR: to_u8_import
use std::{primitive_conversions::{u16::*, u32::*, u64::*, u8::*,},};
// ANCHOR_END: to_u8_import

pub fn convert_uint_to_u8() {
// Convert any unsigned integer to `u8`
// ANCHOR: to_u8
Expand Down
8 changes: 6 additions & 2 deletions forc-pkg/src/pkg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1904,9 +1904,13 @@ pub fn compile(
if let ProgramABI::Fuel(ref mut program_abi) = program_abi {
if let Some(ref mut configurables) = program_abi.configurables {
// Filter out all dead configurables (i.e. ones without offsets in the bytecode)
configurables.retain(|c| compiled.config_const_offsets.contains_key(&c.name));
configurables.retain(|c| {
compiled
.named_data_section_entries_offsets
.contains_key(&c.name)
});
// Set the actual offsets in the JSON object
for (config, offset) in compiled.config_const_offsets {
for (config, offset) in compiled.named_data_section_entries_offsets {
if let Some(idx) = configurables.iter().position(|c| c.name == config) {
configurables[idx].offset = offset;
}
Expand Down
Loading

0 comments on commit 0fbdb27

Please sign in to comment.