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

Allow empty strings in <text> and <type> of <link> #93

Merged
merged 2 commits into from
Aug 29, 2023

Conversation

w-flo
Copy link
Contributor

@w-flo w-flo commented Aug 23, 2023

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGELOG.md if knowledge of this change could be valuable to users.

I've sneaked in a second commit in this PR, to add a changelog entry for my previous PR that was merged without a changelog entry. After looking at the changelog, it seems like my previous decision to skip adding an entry was incorrect (the change probably was more important for users than CI rust version bumps).

Open question for this change: Should <text></text> result in text = Some("") or text = None? I like the current Some("") approach since I suspect some applications use this crate to read, change and then write GPX files. If Some("") was changed to None through some magic, the resulting GPX file would have the <text></text> removed. There would also be some (arguably mostly irrelevant) loss of information ("is there an empty text tag or no text tag?") when reading a GPX file. However, changing it to None might be helpful for applications since most would probably want to treat an emptry string the same as no string. I'd be fine with both approaches.

@w-flo
Copy link
Contributor Author

w-flo commented Aug 28, 2023

Thanks for the review @lnicola :-)

@lnicola
Copy link
Member

lnicola commented Aug 29, 2023

bors r+

bors bot added a commit that referenced this pull request Aug 29, 2023
93: Allow empty strings in `<text>` and `<type>` of `<link>` r=lnicola a=w-flo

- [X] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md).
- [X] I added an entry to `CHANGELOG.md` if knowledge of this change could be valuable to users.
---

I've sneaked in a second commit in this PR, to add a changelog entry for my previous PR that was merged without a changelog entry. After looking at the changelog, it seems like my previous decision to skip adding an entry was incorrect (the change probably was more important for users than CI rust version bumps).

Open question for this change: Should `<text></text>` result in `text = Some("")` or `text = None`? I like the current `Some("")` approach since I suspect some applications use this crate to read, change and then write GPX files. If `Some("")` was changed to `None` through some magic, the resulting GPX file would have the `<text></text>` removed. There would also be some (arguably mostly irrelevant) loss of information ("is there an empty text tag or no text tag?") when reading a GPX file. However, changing it to `None` might be helpful for applications since most would probably want to treat an emptry string the same as no string. I'd be fine with both approaches.

Co-authored-by: Florian Will <florian.will@gmail.com>
@bors
Copy link
Contributor

bors bot commented Aug 29, 2023

Build failed:

The GPX schema just says these are optional `xsd:string` elements, and
apparently the empty string is perfectly legal here.

Fixes georust#92
I've noticed the file is basically just a list of PRs that were merged
with the "knowledge of the change is valuable to users" threshold being
quite low. So I changed my decision from last time and added the PR. :-)
@w-flo
Copy link
Contributor Author

w-flo commented Aug 29, 2023

Thanks for the MSRV bump! I rebased this PR just now

@lnicola
Copy link
Member

lnicola commented Aug 29, 2023

Thanks!

bors r+

@bors
Copy link
Contributor

bors bot commented Aug 29, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 6d50409 into georust:master Aug 29, 2023
1 check passed
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.

None yet

2 participants