Skip to content

Implement enum variants#255

Merged
GuillaumeGomez merged 2 commits intoaskama-rs:masterfrom
Kijewski:pr-enum
Jan 26, 2025
Merged

Implement enum variants#255
GuillaumeGomez merged 2 commits intoaskama-rs:masterfrom
Kijewski:pr-enum

Conversation

@Kijewski
Copy link
Copy Markdown
Member

Resolves #223.

Comment thread rinja_derive/src/integration.rs Fixed
Comment thread rinja_derive/src/integration.rs Fixed
Comment thread rinja_derive/src/integration.rs Fixed
@Kijewski Kijewski force-pushed the pr-enum branch 4 times, most recently from faae42b to b9f1a5f Compare November 24, 2024 03:27
@Kijewski Kijewski force-pushed the pr-enum branch 3 times, most recently from efdb6fc to 06290b4 Compare November 24, 2024 04:40
Comment thread rinja_derive/src/input.rs
@Kijewski Kijewski force-pushed the pr-enum branch 6 times, most recently from a2e9198 to 33afb4c Compare November 24, 2024 23:13
Comment thread rinja_derive/src/integration.rs Fixed
@Kijewski Kijewski force-pushed the pr-enum branch 6 times, most recently from a948a9d to aa66f84 Compare November 26, 2024 00:53
@GuillaumeGomez
Copy link
Copy Markdown
Collaborator

Please tell me when it's ready for final review. ;)

(also git conflict)

@Kijewski Kijewski force-pushed the pr-enum branch 4 times, most recently from 548f53d to 61ef8e8 Compare January 25, 2025 18:52
@Kijewski Kijewski marked this pull request as ready for review January 25, 2025 19:55
@Kijewski Kijewski changed the title [WIP] Implement enum variants Implement enum variants Jan 25, 2025
Comment thread book/src/creating_templates.md Outdated
Comment thread book/src/creating_templates.md Outdated
Comment thread book/src/creating_templates.md Outdated
) -> Result<usize, CompileError> {
let ctx = &contexts[&input.path];
if tmpl_kind == TmplKind::Struct {
buf.write("const _: () = { extern crate rinja as rinja;");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is the as rinja part useful?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The same line extern crate rinja as rinja; already exists at other places outside of this PR's changes.

Right now it's a placeholder. I plan to add a crate_ argument to #[template]. That would make it easier to derive Templates in a macro.

Comment thread rinja_derive/src/generator.rs
Comment thread rinja_derive/src/integration.rs
Comment thread rinja_derive/src/integration.rs
@GuillaumeGomez
Copy link
Copy Markdown
Collaborator

Apart from the small nits, it looks good to me, great work! Can't wait for this to be merged. :3

@Kijewski
Copy link
Copy Markdown
Member Author

Thank you for the proofreading! Fixed the typos.

@GuillaumeGomez
Copy link
Copy Markdown
Collaborator

Thanks for the replies. Still not sure to understand the use case of extern as but not a blocker so let's merge. Thanks a lot for the PR!

@GuillaumeGomez GuillaumeGomez merged commit e81ca42 into askama-rs:master Jan 26, 2025
@Kijewski Kijewski mentioned this pull request Jan 28, 2025
@Kijewski Kijewski deleted the pr-enum branch February 9, 2025 05:26
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.

Add enum support

3 participants