This commit is contained in:
sxyazi 2025-05-28 16:37:27 +08:00
parent 9577818afb
commit 7db6d02333
No known key found for this signature in database
2 changed files with 10 additions and 14 deletions

View file

@ -30,13 +30,11 @@ impl FromLua for Align {
0 => ratatui::layout::Alignment::Left,
1 => ratatui::layout::Alignment::Center,
2 => ratatui::layout::Alignment::Right,
_ => {
return Err(mlua::Error::FromLuaConversionError {
from: value.type_name(),
to: "Align".to_string(),
message: Some("invalid value for Align".to_string()),
});
}
_ => Err(mlua::Error::FromLuaConversionError {
from: value.type_name(),
to: "Align".to_string(),
message: Some("invalid value for Align".to_string()),
})?,
}))
}
}

View file

@ -40,13 +40,11 @@ impl FromLua for Wrap {
0 => None,
1 => Some(ratatui::widgets::Wrap { trim: false }),
2 => Some(ratatui::widgets::Wrap { trim: true }),
_ => {
return Err(mlua::Error::FromLuaConversionError {
from: value.type_name(),
to: "Wrap".to_string(),
message: Some("invalid value for Wrap".to_string()),
});
}
_ => Err(mlua::Error::FromLuaConversionError {
from: value.type_name(),
to: "Wrap".to_string(),
message: Some("invalid value for Wrap".to_string()),
})?,
}))
}
}