Skip to content

more consistent function naming style #52

@eminence

Description

@eminence

There are some naming inconsistencies that have been bothering me for a while, and I'd like to solicit input for anyone who has some. There is a mix of free functions that return structures, and constructor methods on structs. Some examples:

  • There's a free function process::all_processes() -> ProcResult<Vec<Process>> to get all processes, but a method Process::new(pid) -> ProcResult<Process> to get a single process
  • There's a free function cpuinfo() -> ProcResult<CpuInfo> to get CPU Info, but when getting memory info, you use a constructor method Meminfo::new() -> ProcResult<MemInfo>

My personal inclination is to remove the number of free functions (except when necessary, because there's no struct to attach to. boot_time_secs() -> ProcResult<u64> is a good example of this), but I'm curious to know if anyone else has any thoughts on this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions