• BB_C@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    1 day ago

    That’s a question of API, not type system. And FD types (e.g. OwnedFd, BorrowedFd) are already in std.

    • TehPers@beehaw.org
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 day ago

      That’s a question of API, not type system.

      It’s only enforced because of Rust’s strict type system. Python, on the other hand, lets you do whatever you want by comparison, and complains only at runtime. I’ve seen far too many **kwargs for my liking.

      And FD types (e.g. OwnedFdBorrowedFd) are already in std.

      My example would be a thin wrapper around these, most likely. It’s only an example of what I’m trying to convey, though.