Skip to content

Misc fixes#70

Merged
NathanLovato merged 1 commit intoGDQuest:mainfrom
fstxz:cleanup
Sep 23, 2025
Merged

Misc fixes#70
NathanLovato merged 1 commit intoGDQuest:mainfrom
fstxz:cleanup

Conversation

@fstxz
Copy link
Copy Markdown
Contributor

@fstxz fstxz commented Sep 23, 2025

A bunch of minor fixes

  • Updated readme, removed info that isn't relevant anymore.
  • Changed Rust editon to 2024 to be able to use let chains in reorder.rs
  • formatter.rs:
    • Don't copy file content if replace_all didn't replace anything
    • Make handle_two_blank_line() a method of Formatter.
  • reorder.rs:
    • Removed hardcoded priorities from BUILTIN_VIRTUAL_METHODS.
    • extract_*_name() methods: updated to use methods like strip_prefix() and split_once() instead of manual string manipulation
    • Added periods to some docstrings

@NathanLovato NathanLovato merged commit b93a47f into GDQuest:main Sep 23, 2025
@NathanLovato
Copy link
Copy Markdown
Contributor

Thanks much!

@fstxz fstxz deleted the cleanup branch September 23, 2025 19:57
@fstxz
Copy link
Copy Markdown
Contributor Author

fstxz commented Sep 23, 2025

Finally I don't have to rebase this constantly anymore

Comment thread src/formatter.rs
Comment on lines +220 to +222
if let Cow::Owned(replaced) = re.replace_all(&self.content, "\n") {
self.content = replaced;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool, Cow is a built-in copy on write mechanism? Is it like if replace_all replaces anything it returns a new string, otherwise a sort of reference or type meaning no changes are needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct! You can check replace_all's description. It basically returns a reference to the haystack (content) if it didn't find anything.

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.

2 participants