Commit Graph

16 Commits

Author SHA1 Message Date
Wolfgang Bumiller
ce0b21805c lang: deprecate io_err_other
For regular error cases, `std::io::Error` can now also box errors and
provides an `Error::other()` function since rust 1.74.

For the case where it was used directly with strings
(io_err_other("string")) -> that's what `io_format_err!()` and
`io_bail!()` are for.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-26 12:14:03 +02:00
Wolfgang Bumiller
0652d81977 tree-wide: enable doc_cfg and doc_auto_cfg for docs
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-07-02 11:59:53 +02:00
Wolfgang Bumiller
38992a588a lang: deprecate c_str! and offsetof
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-06-20 10:55:10 +02:00
Wolfgang Bumiller
484f12f3aa lang: drop commented-out c_str! implementation variants
This was an old version of a const-fn compatible checked c_str
implementation which was never enabled.

When we get rust 1.72, `CStr::from_bytes_with_nul` becomes usable in
const contexts.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-05-24 12:58:06 +02:00
Wolfgang Bumiller
4de145aaef lang: update c_str
drop the let binding, easier to use in const context since
CStr::from_bytes_with_nul_unchecked is const since 1.59

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-07-26 12:27:44 +02:00
Wolfgang Bumiller
b06b4c7426 lang: clippy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 10:06:57 +02:00
Thomas Lamprecht
ae9d6e255c lang: rustfmt
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-10 12:41:44 +02:00
Wolfgang Bumiller
fc4e02a34f lang: remove io_assert
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-21 13:41:59 +01:00
Dominik Csapak
d4b4115400 move io error helpers to proxmox-lang
this removes proxmox_sys as a dependecy for proxmox-async

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-21 13:35:14 +01:00
Wolfgang Bumiller
19c29ab9b2 clipy fixes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-11-22 09:07:29 +01:00
Wolfgang Bumiller
5b2e8b4c66 Revert "lang: get offsetof const fn ready"
This reverts commit 8f89f9ad60.

generates broken code in release builds on current rustc
1.55
2021-11-17 10:07:08 +01:00
Wolfgang Bumiller
f63ce12b66 lang: prepare c_str for const fns with 1.56
provides an api compatible const-fn-compatible c_str
alternative working on 1.56

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-12 14:29:03 +02:00
Wolfgang Bumiller
8f89f9ad60 lang: get offsetof const fn ready
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-12 14:14:25 +02:00
Wolfgang Bumiller
af33a97547 lang: deprecate ops::ControlFlow
as we now have rustc 1.55

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-12 14:13:59 +02:00
Wolfgang Bumiller
41f3fdfeb9 add proxmox-schema and proxmox-router crates
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-11 11:39:59 +02:00
Wolfgang Bumiller
91f59f9f59 add proxmox-lang crate
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-10-08 15:22:17 +02:00