rust_hdl icon indicating copy to clipboard operation
rust_hdl copied to clipboard

Use of "Pad" dependency

Open jeinstei opened this issue 8 months ago • 2 comments

I was just curious why there is a dependency on "Pad" when the Rust format command looks like it might be able to fulfill the need without pulling in another crate? Happy to push a PR to this effect, but thought that I would see if I am missing something obvious first.

https://github.com/VHDL-LS/rust_hdl/blob/4f20cbded129a2ed44e245de49907e5b1da69b8a/vhdl_lang/src/data/source.rs#L363

https://doc.rust-lang.org/std/fmt/#fillalignment

It seems like this could be done without an extra crate, basically. Especially for just the one usage.

jeinstei avatar Aug 28 '25 09:08 jeinstei

I don't think there is a compelling reason to use the pad crate as you mention - especially since it's only used this one time. I'm not sure why this dependency was introduced - maybe the fill/alignment capabilities weren't as good as they are now? This could have also been a simple oversight or there might have been some more elaborate code that was optimised later on. Anyways, I'd be happy to remove this dependency and merge a PR from you since the standard library seems to contain the required functionality.

Schottkyc137 avatar Aug 28 '25 09:08 Schottkyc137

Awesome -- I'll take a look and get this out once soon then.

jeinstei avatar Aug 28 '25 10:08 jeinstei