Commit Graph

5 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
decf99f71b
Use File instead of OwnedFd in a few places (#10355)
This is a step towards converting `wopen_cloexec()` to return `File` instead of
`OwnedFd`/`AutocloseFd`.¹

In addition to letting us use native standard library functions instead of
unsafe libc calls, we gain additional semantic safety because `File` operations
that manipulate the state of the fd (e.g. `File::seek()`) require a `&mut`
reference to the `File`, whereas using `RawFd` or `OwnedFd` everywhere leaves us
in a position where it's not clear whether or not other references to the same
fd will manipulate its underlying state.

¹ We actually wouldn't even need `wopen_cloexec()` at all (just a widechar
wrapper) as Rust's native `File::open()`/`File::create()` functionality uses
`FD_CLOEXEC` internally.
2024-03-17 11:20:44 -05:00
Mahmoud Al-Qudsi
58a6eb6e45 Convert fish_mkstemp_cloexec() to return an OwnedFd 2024-03-09 15:21:47 -06:00
Johannes Altmanninger
a1ed63fd83 Make wcwidth an isize
Seems more consistent with the rest of our code.
2024-02-15 01:27:23 +01:00
Johannes Altmanninger
8545b5debe Remove obsolete no_mangle directives 2024-02-15 01:22:37 +01:00
Johannes Altmanninger
3ae20bdba0 Move fish-rust to project root 2024-01-13 03:58:33 +01:00