Skip to content

Commit 917d2b0

Browse files
committed
partial git revert
1 parent e63b3d1 commit 917d2b0

File tree

2 files changed

+7
-16
lines changed
  • component-model

2 files changed

+7
-16
lines changed

component-model/examples/tutorial/adder/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#[allow(warnings)]
22
mod bindings;
33

4-
// The comments that follow the use declaration below correlate the rust module path with their
4+
// The comments that follow the `use` declaration below
5+
// correlate the rust module path segments with their
56
// `world.wit` counterparts:
67
use bindings::exports::docs::adder::add::Guest;
78
// <- items bundled with `export` keyword

component-model/src/language-support/rust.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,14 @@ Install [`wasmtime`](https://github.com/bytecodealliance/wasmtime#installation):
2222
```sh
2323
curl https://wasmtime.dev/install.sh -sSf | bash
2424
```
25-
Clone the [component-docs](https://github.com/bytecodealliance/component-docs) repo:
26-
```sh
27-
git clone https://github.com/bytecodealliance/component-docs
28-
```
2925

3026
## 2. Scaffolding a Component
3127

3228
We will create a component in Rust that implements the `add` function exported
33-
by the [`adder` world][docs-adder] world in the
34-
`docs:adder`
29+
by the [`adder` world][docs-adder] world in the `docs:adder`
3530
[package](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#package-names).
3631

37-
First `cd` into the `tutorial` directory found in the repo we just cloned:
38-
```sh
39-
cd component-docs/component-model/examples/tutorial
40-
```
41-
42-
Now create a new WebAssembly component package called `add`:
32+
First, we will create a new WebAssembly component package called `add`:
4333
```sh
4434
cargo component new add --lib && cd add
4535
```
@@ -183,7 +173,7 @@ Because the `docs:adder` package is in a different project, we must first tell `
183173

184174
```toml
185175
[package.metadata.component.target.dependencies]
186-
"docs:adder" = { path = "../wit/adder" } # directory containing the WIT package
176+
"docs:adder" = { path = "../adder/wit" } # directory containing the WIT package
187177
```
188178

189179
> [!NOTE]
@@ -294,8 +284,8 @@ As mentioned above, `cargo component build` doesn't generate a WIT file for a co
294284
295285
```toml
296286
[package.metadata.component.target.dependencies]
297-
"docs:calculator" = { path = "../wit/calculator" }
298-
"docs:adder" = { path = "../wit/adder" }
287+
"docs:calculator" = { path = "../calculator/wit" }
288+
"docs:adder" = { path = "../adder/wit" }
299289
```
300290
301291
> If the external package refers to other packages, you need to provide the paths to them as well.

0 commit comments

Comments
 (0)