sys-info-rs icon indicating copy to clipboard operation
sys-info-rs copied to clipboard

unify all `LinuxOSReleaseInfo` id to lowercase

Open J-ZhengLi opened this issue 2 years ago • 3 comments

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",
        ),
        ...
    },
)

J-ZhengLi avatar Jul 22 '22 09:07 J-ZhengLi

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

FillZpp avatar Jul 25 '22 10:07 FillZpp

@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?

J-ZhengLi avatar Jul 28 '22 02:07 J-ZhengLi

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.

FillZpp avatar Jul 28 '22 03:07 FillZpp