Fix API breakage relating to lifetime tweaks and bitflags attributes
When lifetime annotations were removed from the Package struct, this change necessitated borrowing in code downstream. For example, alpm.rs also returns &Package objects via the pkg function in the Db struct.
This breaks trans_remove_pkg because the function signature only accepts owned Package objects, which makes it seemingly impossible to use.
Further, the update to bitflags also incurred some breakage downstream in my code with regards to the ergonomics of handling TransFlag bitflags attributes in the alpm.rs API. Without the Copy, Clone attributes derived, the only other option is to convert bitflags into an integer with the bits function, and then parse it back into a unique, owned TransFlag object.
Perhaps modifying trans_init to accept a borrowed TransFlag could also be done?
Herein I've included an initial set of patches to fix both of these issues in the interim.
合并状态:已合并 合并于 2024-03-15 关闭于 2024-03-15 7 条评论