Closed mseri closed 9 years ago
Thank you! It's awesome that this works on stable!
Do you think the code would be cleaner if we define the regex!
macro
ourselves in main.rs
(as Regex::new($x).unwrap()
)?
mseri notifications@github.com schrieb am Fr., 26. Juni 2015 um 18:23:
Remove the dependency on regex_macros to make it compatible (and compilable) with rust stable.
I have tested with 1.1 and all the tests are passing and the book is properly generated.
It should be fine even performance-wise, at least according to the discussion here:
http://www.reddit.com/r/rust/comments/3b2i0f/psa_regex_is_now_slower_than_regexnew/
You can view, comment on, or merge this pull request online at:
https://github.com/killercup/trpl-ebook/pull/17 Commit Summary
- Move to regex only to compile with stable
- Revert to 'dev' feature name
File Changes
- M Cargo.lock https://github.com/killercup/trpl-ebook/pull/17/files#diff-0 (9)
- M Cargo.toml https://github.com/killercup/trpl-ebook/pull/17/files#diff-1 (3)
- M src/convert_book/markdown.rs https://github.com/killercup/trpl-ebook/pull/17/files#diff-2 (9)
- M src/helpers/adjust_header_level.rs https://github.com/killercup/trpl-ebook/pull/17/files#diff-3 (5)
- M src/helpers/adjust_reference_names.rs https://github.com/killercup/trpl-ebook/pull/17/files#diff-4 (14)
- M src/helpers/normalize.rs https://github.com/killercup/trpl-ebook/pull/17/files#diff-5 (11)
- M src/helpers/normalize_code_blocks.rs https://github.com/killercup/trpl-ebook/pull/17/files#diff-6 (5)
- M src/helpers/remove_emojis.rs https://github.com/killercup/trpl-ebook/pull/17/files#diff-7 (4)
- M src/helpers/remove_file_title.rs https://github.com/killercup/trpl-ebook/pull/17/files#diff-8 (3)
- M src/main.rs https://github.com/killercup/trpl-ebook/pull/17/files#diff-9 (3)
Patch Links:
- https://github.com/killercup/trpl-ebook/pull/17.patch
- https://github.com/killercup/trpl-ebook/pull/17.diff
— Reply to this email directly or view it on GitHub https://github.com/killercup/trpl-ebook/pull/17.
I don't know.
At first I thought about it too, as a way to revert to regex_macros
as soon as they become stable.
Then I've read that discussion on reddit and decided to go simply with Regex::new.
In addition, even if it's not a problem for a small codebase, it could be confusing to see regex! (that sould be on the stack) and have it dynamical on the heap.
Good point. (The stack-expectation… stackspectation?) Changing it back to the macro form is pretty easy anyway.
I'll merge this later when I get to a computer.
Thanks again! mseri notifications@github.com schrieb am Fr., 26. Juni 2015 um 21:13:
I don't know. At first I thought about it too, as a way to revert to regex_macros as soon as they become stable. Then I've read that discussion on reddit and decided to go simply with Regex::new.
In addition, even if it's not a problem for a small codebase, it could be confusing to see regex! (that sould be on the stack) and have it dynamical on the heap.
— Reply to this email directly or view it on GitHub https://github.com/killercup/trpl-ebook/pull/17#issuecomment-115843237.
Remove the dependency on
regex_macros
to make it compatible (and compilable) with rust stable.I have tested with 1.1 and all the tests are passing and the book is properly generated.
It should be fine even performance-wise, at least according to the discussion here: http://www.reddit.com/r/rust/comments/3b2i0f/psa_regex_is_now_slower_than_regexnew/