As was done in a recently merged here as part of https://github.com/georust/geozero/pull/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.
As was done in a recently merged here as part of https://github.com/georust/geozero/pull/155 for
WktWriter
, we need to removepub
onsrid
anddim
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