Skip to content

Commit

Permalink
feat(ci): check for dead links (cairo-book#1010)
Browse files Browse the repository at this point in the history
  • Loading branch information
od-hunter authored Oct 18, 2024
1 parent 852cdd5 commit 18734d9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check Markdown links

on:
push:
branches:
- main

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install markdown-link-check
run: |
npm install -g markdown-link-check
- name: Run markdown-link-check
run: |
find src -name "*.md" | xargs markdown-link-check
6 changes: 3 additions & 3 deletions src/ch11-10-associated-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ _Associated Items_ are the items declared in [traits] or defined in

[traits]: ./ch08-02-traits-in-cairo.md
[implementations]: ./ch08-02-traits-in-cairo.md#implementing-a-trait-on-a-type
[associated types]: ./ch11-10-associated-items-in-traits.md#associated-types
[associated types]: ./ch11-10-associated-items.md#associated-types
[associated functions]: ./ch05-03-method-syntax.md#associated-functions
[associated constants]: ./ch11-10-associated-items-in-traits.md#associated-constants
[associated implementations]: ./ch11-10-associated-items-in-traits.md#associated-implementations
[associated constants]: ./ch11-10-associated-items.md#associated-constants
[associated implementations]: ./ch11-10-associated-items.md#associated-implementations

Associated items are useful when they are logically related to the implementation. For example, the `is_some` method on `Option` is intrinsically related to Options, so should be associated.

Expand Down
2 changes: 0 additions & 2 deletions src/ch14-01-02-storage-vecs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ The `Vec` type is provided by the Cairo core library, inside the `core::starknet

> The `Array<T>` type is a **memory** type and cannot be directly stored in contract storage. For storage, use the `Vec<T>` type, which is a [phantom type][phantom types] designed specifically for contract storage. However, `Vec<T>` has limitations: it can't be instantiated as a regular variable, used as a function parameter, or included as a member in regular structs. To work with the full contents of a `Vec<T>`, you'll need to copy its elements to and from a memory `Array<T>`.
[phantom types]: ./ch11-05-phantom-data.html#phantom-type-in-generics

## Declaring and Using Storage Vectors

To declare a Storage Vector, use the `Vec` type enclosed in angle brackets `<>`, specifying the type of elements it will store. In Listing {{#ref storage-vecs}}, we create a simple contract that registers all the addresses that call it and stores them in a `Vec`. We can then retrieve the `n`-th registered address, or all registered addresses.
Expand Down

0 comments on commit 18734d9

Please sign in to comment.