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

Make srid & dim fields of all writers private, and add ctor #156

Open
nyurik opened this issue Aug 12, 2023 · 0 comments
Open

Make srid & dim fields of all writers private, and add ctor #156

nyurik opened this issue Aug 12, 2023 · 0 comments

Comments

@nyurik
Copy link
Member

nyurik commented Aug 12, 2023

As was done in a recently merged here as part of #155 for WktWriter, we need to remove pub on srid and dim fields, making it an internal implementation detail. Instead, there should be an extra writer constructor, e.g. WktWriter::with_opts(&mut out, dialect, dims, srid) that takes all the needed options.

This makes access cleaner, and removes a potential bug of dynamically changing srid or dimensions during processing. Unless of course the writer should support their dynamic modification, but even in that case it should be a function, not external variable access.

cc: @pka @Oreilles

pka added a commit that referenced this issue Aug 18, 2023
Adress #156 and fix different dimensions in reader and writer.
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

No branches or pull requests

1 participant