http-server-rs / http-server

Simple and configurable command-line HTTP server
https://crates.io/crates/http-server
Apache License 2.0
182 stars 20 forks source link

[Feature Request] Unnecessary getters on Config sturct #401

Closed Antosser closed 8 months ago

Antosser commented 11 months ago

https://github.com/http-server-rs/http-server/blob/7eabb9b02b678f2f5b0df1f27948a99c1f484409/src/config/mod.rs#L4

I really don't understand why you'd want getters for these fields. It seems unnecessary because you could simply make the fields public.

If the goal was to make the fields immutable, you could just instantiate the struct without the mut keyword

EstebanBorai commented 11 months ago

I agree with you!

Given that this was my first Rust project, back in the day I had other POV on software design!

Good observation!

PR welcome!

Antosser commented 11 months ago

I'd wait for #374 before doing this one because I don't really want to introduce any merge conflicts

EstebanBorai commented 11 months ago

I'd wait for #374 before doing this one because I don't really want to introduce any merge conflicts

Sgtm!

Antosser commented 8 months ago

I'll get on with this one since #374 is done