FillZpp / sys-info-rs

Get system information in Rust.
MIT License
168 stars 57 forks source link

unify all `LinuxOSReleaseInfo` id to lowercase #112

Open J-ZhengLi opened 2 years ago

J-ZhengLi commented 2 years ago

the documentation of that struct states the id as "A lower-case string", however, it is not a lowercase string on some distro such as openEuler.

output of debug printing:

Ok(
    LinuxOSReleaseInfo {
        id: Some(
            "openEuler",
        ),
        id_like: None,
        name: Some(
            "openEuler",
        ),
        pretty_name: Some(
            "openEuler 20.03 (LTS-SP1)",
        ),
        version: Some(
            "20.03 (LTS-SP1)",
        ),
        version_id: Some(
            "20.03",
        ),
        ...
    },
)
FillZpp commented 2 years ago

@J-ZhengLi Please feel free to open a PR to fix the doc.

J-ZhengLi commented 2 years ago

@J-ZhengLi Please feel free to open a PR to fix the doc.

Sure :thinking: but before I do, I have a simple question. I know this might be a job for the OS provider, but what's the downside of converting the return string to lowercase here?

FillZpp commented 2 years ago

Emm, I don't think it's a good idea to add a convertion here. Maybe just let the return string be same to the real one from the OS provider.