Skip to content

Commit b78c30c

Browse files
committed
fix: cairo cheatsheet in sub listing
1 parent ac41ee5 commit b78c30c

32 files changed

+16
-20
lines changed

Diff for: Scarb.lock

-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ dependencies = [
1818
"snforge_std",
1919
]
2020

21-
[[package]]
22-
name = "cairo_cheatsheet"
23-
version = "0.1.0"
24-
2521
[[package]]
2622
name = "calling_other_contracts"
2723
version = "0.1.0"
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: pages/cairo_cheatsheet/arrays.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ trait ArrayTrait<T> {
2020
For example:
2121

2222
```cairo
23-
// [!include ~/listings/cairo_cheatsheet/src/array_example.cairo]
23+
// [!include ~/listings/cairo_cheatsheet/listing/src/array_example.cairo]
2424
```

Diff for: pages/cairo_cheatsheet/dict.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ A dictionary is a data structure used to store key-value pairs, enabling efficie
88
For example:
99

1010
```cairo
11-
// [!include ~/listings/cairo_cheatsheet/src/dict_example.cairo:sheet]
11+
// [!include ~/listings/cairo_cheatsheet/listing/src/dict_example.cairo:sheet]
1212
```

Diff for: pages/cairo_cheatsheet/enums.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Just like other programming languages, enums (enumerations) are used in cairo to
55
In cairo, `enum variants` can hold different data types (the unit type, structs, other enums, tuples, default core library types, arrays, dictionaries, ...), as shown in the code snippet below. Furthermore, as a quick reminder, enums are expressions, meaning they can return values.
66

77
```cairo
8-
// [!include ~/listings/cairo_cheatsheet/src/enum_example.cairo:enums]
8+
// [!include ~/listings/cairo_cheatsheet/listing/src/enum_example.cairo:enums]
99
```
1010

1111
Enums can be declared both inside and outside a contract. If declared outside, they need to be imported inside using the `use` keyword, just like other imports.
@@ -24,5 +24,5 @@ Enums can be declared both inside and outside a contract. If declared outside, t
2424
Here is an example of a contract illustrating the above statements :
2525

2626
```cairo
27-
// [!include ~/listings/cairo_cheatsheet/src/enum_example.cairo:enum_contract]
27+
// [!include ~/listings/cairo_cheatsheet/listing/src/enum_example.cairo:enum_contract]
2828
```

Diff for: pages/cairo_cheatsheet/felt.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Felt
22

33
`felt252` is a fundamental data type in Cairo from which all other data types are derived.
4-
`felt252` can also be used to store [short string representations](/getting-started/basics/bytearrays-strings#short-strings) with a maximum length of 31 characters.
4+
`felt252` can also be used to store 'short string representations' with a maximum length of 31 characters.
55

66
For example:
77

88
```cairo
9-
// [!include ~/listings/cairo_cheatsheet/src/felt_example.cairo:sheet]
9+
// [!include ~/listings/cairo_cheatsheet/listing/src/felt_example.cairo:sheet]
1010
```

Diff for: pages/cairo_cheatsheet/if_let.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A `if let` statement is a combination of an `if` statement and a `let` statement. It allows you to execute the block only if the pattern matches. It's a cleaner way to handle a `match` statement with only one pattern that you want to handle.
44

55
```cairo
6-
// [!include ~/listings/cairo_cheatsheet/src/if_let_example.cairo:sheet]
6+
// [!include ~/listings/cairo_cheatsheet/listing/src/if_let_example.cairo:sheet]
77
```
88

99
### See also

Diff for: pages/cairo_cheatsheet/loop.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ A `loop` specifies a block of code that will run repetitively until a halting co
55
For example:
66

77
```cairo
8-
// [!include ~/listings/cairo_cheatsheet/src/loop_example.cairo:sheet]
8+
// [!include ~/listings/cairo_cheatsheet/listing/src/loop_example.cairo:sheet]
99
```
1010

1111
### See also

Diff for: pages/cairo_cheatsheet/mapping.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
The `Map` type can be used to represent a collection of key-value.
44

55
```cairo
6-
// [!include ~/listings/cairo_cheatsheet/src/mapping_example.cairo]
6+
// [!include ~/listings/cairo_cheatsheet/listing/src/mapping_example.cairo]
77
```

Diff for: pages/cairo_cheatsheet/match.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ The `match` expression in Cairo allows us to control the flow of our code by com
55
For example:
66

77
```cairo
8-
// [!include ~/listings/cairo_cheatsheet/src/match_example.cairo]
8+
// [!include ~/listings/cairo_cheatsheet/listing/src/match_example.cairo]
99
```

Diff for: pages/cairo_cheatsheet/struct.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ A struct is a data type similar to a tuple. Like tuples, they can be used to hol
55
For example:
66

77
```cairo
8-
// [!include ~/listings/cairo_cheatsheet/src/struct_example.cairo]
8+
// [!include ~/listings/cairo_cheatsheet/listing/src/struct_example.cairo]
99
```

Diff for: pages/cairo_cheatsheet/tuples.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ Tuples is a data type to group a fixed number of items of potentially different
55
For example:
66

77
```cairo
8-
// [!include ~/listings/cairo_cheatsheet/src/tuple_example.cairo:sheet]
8+
// [!include ~/listings/cairo_cheatsheet/listing/src/tuple_example.cairo:sheet]
99
```

Diff for: pages/cairo_cheatsheet/type_casting.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ The `into` method is used for conversion from a smaller data type to a larger da
66
For example:
77

88
```cairo
9-
// [!include ~/listings/cairo_cheatsheet/src/type_casting_example.cairo:sheet]
9+
// [!include ~/listings/cairo_cheatsheet/listing/src/type_casting_example.cairo:sheet]
1010
```

Diff for: pages/cairo_cheatsheet/while.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A `while` loop allows you to specify a condition that must be true for the loop to continue.
44

55
```cairo
6-
// [!include ~/listings/cairo_cheatsheet/src/while_example.cairo:sheet]
6+
// [!include ~/listings/cairo_cheatsheet/listing/src/while_example.cairo:sheet]
77
```
88

99
### See also

Diff for: pages/cairo_cheatsheet/while_let.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
A `while let` loop is a combination of a `while` loop and a `let` statement. It allows you to execute the loop body only if the pattern matches.
44

55
```cairo
6-
// [!include ~/listings/cairo_cheatsheet/src/while_let_example.cairo:sheet]
6+
// [!include ~/listings/cairo_cheatsheet/listing/src/while_let_example.cairo:sheet]
77
```
88

99
### See also

Diff for: pages/getting-started/testing/contract-testing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ To make testing more convenient, the `testing` module of the corelib provides so
7272
- `pop_log<T, +starknet::Event<T>>(address: ContractAddress) -> Option<T>`
7373
- `pop_l2_to_l1_message(address: ContractAddress) -> Option<(felt252, Span<felt252>)>`
7474

75-
You may also need the `info` module from the corelib, which allows you to access information about the current execution context (see [syscalls](/getting-started/basics/syscalls)):
75+
You may also need the `info` module from the corelib, which allows you to access information about the current execution context (see [syscalls](/getting-started/syscalls)):
7676

7777
- `get_caller_address() -> ContractAddress`
7878
- `get_contract_address() -> ContractAddress`

0 commit comments

Comments
 (0)