Skip to content

feat(stdlib): add Path.removeExtension#2226

Merged
ospencer merged 1 commit intograin-lang:mainfrom
spotandjake:spotandjake-path-remove-ext
Feb 16, 2025
Merged

feat(stdlib): add Path.removeExtension#2226
ospencer merged 1 commit intograin-lang:mainfrom
spotandjake:spotandjake-path-remove-ext

Conversation

@spotandjake
Copy link
Copy Markdown
Member

This adds Path.removeExtension to the Path library as I noticed there wasn't really a great way todo it before

@alex-snezhko
Copy link
Copy Markdown
Member

Would it be better to have an updateExtension/withExtension function that you could just pass in None to remove

@spotandjake
Copy link
Copy Markdown
Member Author

Would it be better to have an updateExtension/withExtension function that you could just pass in None to remove

I was debating an updateExtension but I honestly think we should still have removeExtension it's more intuitive and clear what it does and then updateExtension can just take a string.

Copy link
Copy Markdown
Member

@ospencer ospencer left a comment

Choose a reason for hiding this comment

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

I think this is reasonable to have. I could additionally see an updateExtension to change it, but I like them being separate because it's easy to search for.

@ospencer ospencer added this pull request to the merge queue Feb 16, 2025
Merged via the queue into grain-lang:main with commit 7b7acfd Feb 16, 2025
@github-actions github-actions bot mentioned this pull request Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants