Will be used/passed around quite a lot of times due to future changes,
so simplify it a bit.
No functional changes.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
/// https://openzfs.github.io/openzfs-docs/Performance%20and%20Tuning/Module%20Parameters.html#zfs-arc-max
const ZFS_ARC_MIN_SIZE_MIB: usize = 64; // MiB
/// https://openzfs.github.io/openzfs-docs/Performance%20and%20Tuning/Module%20Parameters.html#zfs-arc-max
const ZFS_ARC_MIN_SIZE_MIB: usize = 64; // MiB
+/// Convience wrapper when needing to take a (interior-mutable) reference to `BootdiskOptions`.
+/// Interior mutability is safe for this case, as it is completely single-threaded.
+pub type BootdiskOptionsRef = Rc<RefCell<BootdiskOptions>>;
+
pub struct BootdiskOptionsView {
view: LinearLayout,
pub struct BootdiskOptionsView {
view: LinearLayout,
- advanced_options: Rc<RefCell<BootdiskOptions>>,
+ advanced_options: BootdiskOptionsRef,
fn advanced_options_view(
runinfo: &RuntimeInfo,
fn advanced_options_view(
runinfo: &RuntimeInfo,
- options: Rc<RefCell<BootdiskOptions>>,
+ options_ref: BootdiskOptionsRef,
product_conf: ProductConfig,
) -> impl View {
Dialog::around(AdvancedBootdiskOptionsView::new(
runinfo,
product_conf: ProductConfig,
) -> impl View {
Dialog::around(AdvancedBootdiskOptionsView::new(
runinfo,
+ &(*options_ref).borrow(),
product_conf,
))
.title("Advanced bootdisk options")
.button("Ok", {
product_conf,
))
.title("Advanced bootdisk options")
.button("Ok", {
- let options_ref = options.clone();
+ let options_ref = options_ref.clone();
move |siv| {
let options = siv
.call_on_name("advanced-bootdisk-options-dialog", |view: &mut Dialog| {
move |siv| {
let options = siv
.call_on_name("advanced-bootdisk-options-dialog", |view: &mut Dialog| {