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: option to use ByteArray instead of Array<felt252> #10

Merged
merged 11 commits into from
Jul 8, 2024

Conversation

TropicalDog17
Copy link
Contributor

@TropicalDog17 TropicalDog17 commented Jun 25, 2024

Description

Closes #9

Checklist

  • Add an option to change cairo base type (used in functions input and output)
  • Program is usable without the option specified (defaulting to Array)
  • Program is usable with option specified and will fail if type other than ByteArray is specified
  • Code decoupling to write cairo program should be decoupled for different type handlers
  • Common code should be then generic

@TropicalDog17 TropicalDog17 marked this pull request as draft June 25, 2024 07:46
Copy link
Contributor

@MartianGreed MartianGreed left a comment

Choose a reason for hiding this comment

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

Great work, just one minor comment ! Keep rockin'

@@ -28,6 +28,7 @@ pub struct SvgElement {
pub attributes: HashMap<String, String>,
pub replacement: HashMap<String, String>,
pub nodes: Vec<SvgElement>,
pub type_override: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should use an enum for that kind of handling. Enum can implement Display trait, it should simplify handling of logic afterwards

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm still quite new to Rust, thanks a lot for your advice!

@TropicalDog17 TropicalDog17 marked this pull request as ready for review June 25, 2024 16:07
src/writer/mod.rs Outdated Show resolved Hide resolved
test-2.cairo Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

this file should be ignored !

test.cairo Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

this file can be ignored too or placed into an examples/cairo directory

Comment on lines 9 to 10
svg.append('<g><text><tspan>Carbon units</t'
svg.append('span></text></g>'
Copy link
Contributor

Choose a reason for hiding this comment

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

can we fix this file please ?

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.

Option to use ByteArray instead of Array<felt252>
3 participants