Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: derive PrintTrait #721

Merged
merged 3 commits into from
Aug 8, 2023

Conversation

ftupas
Copy link
Contributor

@ftupas ftupas commented Aug 7, 2023

Hello, this pr does the follow

This is an example of the logging

running 3 tests
test dojo_examples::components::test_position_is_zero ... ok
test dojo_examples::components::test_position_is_equal ... ok
[DEBUG] player                          (raw: 0x706c61796572

[DEBUG]                                 (raw: 0x0

[DEBUG] remaining                       (raw: 0x72656d61696e696e67

[DEBUG]                                         (raw: 0x9

test dojo_examples::systems::tests::test_move ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 filtered out;

crates/dojo-lang/src/component.rs Outdated Show resolved Hide resolved
crates/dojo-lang/src/component.rs Outdated Show resolved Hide resolved
crates/dojo-lang/src/plugin_test_data/component Outdated Show resolved Hide resolved
@ftupas ftupas force-pushed the feat/derive-printtrait-component branch from 2089ef9 to 2321120 Compare August 7, 2023 19:35
@ftupas ftupas force-pushed the feat/derive-printtrait-component branch from 2321120 to d59a188 Compare August 7, 2023 19:43
Copy link
Contributor

@tarrencev tarrencev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small improvement otherwise lgtm! once we qualify the trait we can remove all the imports (except where we actually use .print())

examples/ecs/src/components.cairo Outdated Show resolved Hide resolved
examples/ecs/src/systems.cairo Outdated Show resolved Hide resolved
crates/dojo-lang/src/component.rs Outdated Show resolved Hide resolved
crates/dojo-erc/src/erc20/components.cairo Outdated Show resolved Hide resolved
crates/dojo-core/tests/src/executor.cairo Outdated Show resolved Hide resolved
crates/dojo-core/tests/src/world.cairo Outdated Show resolved Hide resolved
@ftupas ftupas force-pushed the feat/derive-printtrait-component branch from 6cbffa5 to f157e9d Compare August 7, 2023 22:02
@ftupas
Copy link
Contributor Author

ftupas commented Aug 7, 2023

one small improvement otherwise lgtm! once we qualify the trait we can remove all the imports (except where we actually use .print())

Thanks for the review @tarrencev ! Unfortunately, I had to remove the #[cfg(test)] annotation because it's causing cargo test to fail

error: Plugin diagnostic: Method `print` not found on type "dojo_examples::components::Moves". Did you import the correct trait and impl?
 --> inline_macros:55:15
        moves.print();
              ^***^


thread 'compiler::test_compiler' panicked at 'Error compiling: could not compile `dojo_examples` due to previous error', crates/dojo-lang/src/compiler.rs:109:53

@tarrencev tarrencev force-pushed the feat/derive-printtrait-component branch from 9494dc9 to f2086de Compare August 8, 2023 00:53
@tarrencev tarrencev merged commit 492f916 into dojoengine:main Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Derive PrintTrait for components
2 participants