Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Incrementing a counter Issues #421

Closed
ililic opened this issue Apr 28, 2021 · 1 comment
Closed

Incrementing a counter Issues #421

ililic opened this issue Apr 28, 2021 · 1 comment

Comments

@ililic
Copy link

ililic commented Apr 28, 2021

Describe the bug
This bug report will detail issues found in the Incrementing a counter Rust tutorial

** To Reproduce **

  1. Add a open curly bracket in the dfx.json code block to match the close curly brace:
"build": "cargo build --target wasm32-unknown-unknown --package  rust_counter --release",
"candid": "src/rust_counter/counter.did",
"wasm": "target/wasm32-unknown-unknown/release/rust_counter.wasm",
"type": "custom"
}

Should be:

"rust_counter": {
      "build": "cargo build --target wasm32-unknown-unknown --package  rust_counter --release",
      "candid": "src/rust_counter/counter.did",
      "wasm": "target/wasm32-unknown-unknown/release/rust_counter.wasm",
      "type": "custom"
    }
  1. Step Test changing the name back to documentation #4 doesn't have a copy widget on the code block
  2. Version bump the second Cargo.toml (within the src directory). Was:
[package]
name = "rust_counter"
version = "0.1.0"
authors = ["DFINITY <support@dfinity.org>"]
edition = "2018"

[lib]
path = "counter.rs"
crate-type = ["cdylib"]

[dependencies]
ic-cdk = { path = "../../../cdk-rs/src/ic-cdk", version = "0.1.0" }
ic-cdk-macros = { path = "../../../cdk-rs/src/ic-cdk-macros", version = "0.1.0" }
ic-types = "0.1.1"
lazy_static = "1.4.0"

should be

[package]
name = "rust_counter"
version = "0.1.0"
authors = ["DFINITY <support@dfinity.org>"]
edition = "2018"

[lib]
path = "counter.rs"
crate-type = ["cdylib"]

[dependencies]
ic-cdk = { path = "../../../cdk-rs/src/ic-cdk", version = "0.2.4" }
ic-cdk-macros = { path = "../../../cdk-rs/src/ic-cdk-macros", version = "0.2.4" }
ic-types = "0.1.1"
lazy_static = "1.4.0"
@lsgunnlsgunn
Copy link
Contributor

Thanks so much for providing feedback on the documentation. We recently updated the Rust tutorials.
Hope you'll check them out and let us know if we missed anything.

As for the missing copy widget, we have a convention of not including it for examples that you aren't meant to copy and paste as-is, so I think that was intentional (but it might be too subtle of a convention 😁 ).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants