Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: 1.52.1
override: true
components: rustfmt
- name: Run
Expand All @@ -35,7 +35,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: 1.52.1
override: true
components: clippy
- name: Run
Expand All @@ -47,7 +47,7 @@ jobs:
matrix:
os: [ ubuntu-latest ]
rust:
- stable
- 1.52.1
- 1.41.0 # MSRV
fail-fast: true
max-parallel: 2
Expand All @@ -69,7 +69,7 @@ jobs:
matrix:
os: [ ubuntu-latest ]
rust:
- stable
- 1.52.1
- 1.41.0 # MSRV
fail-fast: true
max-parallel: 2
Expand Down
2 changes: 1 addition & 1 deletion bindings/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "molecule"
version = "0.7.1"
version = "0.7.2"
authors = ["Nervos Core Dev <dev@nervos.org>"]
edition = "2018"
description = "Rust bindings for molecule."
Expand Down
2 changes: 1 addition & 1 deletion examples/ci-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "molecule-ci-tests"
version = "0.7.1"
version = "0.7.2"
authors = ["Nervos Core Dev <dev@nervos.org>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion examples/tests-loader/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "molecule-tests-loader"
version = "0.7.1"
version = "0.7.2"
authors = ["Nervos Core Dev <dev@nervos.org>"]
edition = "2018"

Expand Down
9 changes: 9 additions & 0 deletions examples/tests-loader/src/generators/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,15 @@ impl GenTest for types::Vector {
.build();
let expected = #name::from_slice(#expected).unwrap();
#assert_stmt
assert_eq!(
result.total_size(),
result.as_slice().len(),
"\nstruct: {}:\n data: {:#x}\n partial read total_size: {}, actual: {}\n",
#name::NAME,
result,
result.total_size(),
result.as_slice().len()
);
}
);
vec![test]
Expand Down
2 changes: 1 addition & 1 deletion examples/tests-utils-c/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "molecule-tests-utils-c"
version = "0.7.1"
version = "0.7.2"
authors = ["Nervos Core Dev <dev@nervos.org>"]
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion examples/tests-utils-rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "molecule-tests-utils-rust"
version = "0.7.1"
version = "0.7.2"
authors = ["Nervos Core Dev <dev@nervos.org>"]
edition = "2018"

Expand Down
4 changes: 2 additions & 2 deletions tools/codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "molecule-codegen"
version = "0.7.1"
version = "0.7.2"
authors = ["Nervos Core Dev <dev@nervos.org>"]
edition = "2018"
description = "Code generator for molecule."
Expand All @@ -16,7 +16,7 @@ categories = [
license = "MIT"

[dependencies]
molecule = { version = "=0.7.1", path = "../../bindings/rust", default-features = false }
molecule = { version = "=0.7.2", path = "../../bindings/rust", default-features = false }
property = "0.3.3"
pest = "2.1.3"
pest_derive = "2.1.0"
Expand Down
2 changes: 1 addition & 1 deletion tools/codegen/src/generator/languages/rust/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl DefProperties for ast::FixVec {
fn def_properties(&self) -> m4::TokenStream {
quote!(
pub fn total_size(&self) -> usize {
molecule::NUMBER_SIZE * (self.item_count() + 1)
molecule::NUMBER_SIZE + Self::ITEM_SIZE * self.item_count()
}
pub fn item_count(&self) -> usize {
molecule::unpack_number(self.as_slice()) as usize
Expand Down
6 changes: 3 additions & 3 deletions tools/compiler/Cargo.lock

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

4 changes: 2 additions & 2 deletions tools/compiler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "moleculec"
version = "0.7.1"
version = "0.7.2"
authors = ["Nervos Core Dev <dev@nervos.org>"]
edition = "2018"
description = "Schema compiler for molecule."
Expand Down Expand Up @@ -30,7 +30,7 @@ path = "src/compiler-rust.rs"
[dependencies]
clap = { version = "2.33.3", features = ["yaml"] }
which = "4.0.2"
molecule-codegen = { version = "=0.7.1", path = "../codegen", features = ["compiler-plugin"] }
molecule-codegen = { version = "=0.7.2", path = "../codegen", features = ["compiler-plugin"] }

[badges]
maintenance = { status = "experimental" }