rust/library/std
Matthias Krüger 10018d8e10
Rollup merge of #137165 - thaliaarchi:file-tell, r=ChrisDenton
Use `tell` for `<File as Seek>::stream_position`

Some platforms have a more efficient way to get the current offset of the file than by seeking. For example, Wasi has `fd_tell` and SOLID has `SOLID_FS_Ftell`. Implement `<File as Seek>::stream_position()` in terms of those.

I do not use any APIs that were not already used in `std`. Although, the `libc` crate has [`ftell`](https://docs.rs/libc/latest/libc/fn.ftell.html), [`ftello`](https://docs.rs/libc/latest/libc/fn.ftello.html), and [`ftello64`](https://docs.rs/libc/latest/libc/fn.ftello64.html), I do not know platform coverage. It appears that Windows has no `tell`-like API.

I have checked that it builds on each relevant platform.
2025-02-17 17:06:10 +01:00
..
benches Fix import in bench for wasm 2025-02-12 14:44:30 -08:00
src Rollup merge of #137165 - thaliaarchi:file-tell, r=ChrisDenton 2025-02-17 17:06:10 +01:00
tests std: Apply deprecated_safe_2024 2025-02-13 13:10:28 -08:00
build.rs Enable f128 tests on all non-buggy platforms 🎉 2024-11-03 19:33:04 -06:00
Cargo.toml library: Update rand to 0.9.0 2025-02-13 12:20:55 -08:00