mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-10-30 00:11:06 +08:00
bin: Improve property conversion
This commit is contained in:
@@ -119,7 +119,7 @@ where
|
||||
{
|
||||
fn render(&self, frame: &mut ratatui::Frame, _area: Rect, props: Option<Box<dyn Any>>) {
|
||||
let props = props
|
||||
.and_then(|props| WindowProps::from_boxed_any(props))
|
||||
.and_then(WindowProps::from_boxed_any)
|
||||
.unwrap_or(self.props.clone());
|
||||
|
||||
let area = frame.size();
|
||||
@@ -448,7 +448,7 @@ where
|
||||
{
|
||||
fn render(&self, frame: &mut ratatui::Frame, area: Rect, props: Option<Box<dyn Any>>) {
|
||||
let props = props
|
||||
.and_then(|props| BrowsePageProps::from_boxed_any(props))
|
||||
.and_then(BrowsePageProps::from_boxed_any)
|
||||
.unwrap_or(self.props.clone());
|
||||
|
||||
let page_size = area.height.saturating_sub(6) as usize;
|
||||
@@ -733,7 +733,7 @@ where
|
||||
{
|
||||
fn render(&self, frame: &mut ratatui::Frame, area: Rect, props: Option<Box<dyn Any>>) {
|
||||
let props = props
|
||||
.and_then(|props| HelpPageProps::from_boxed_any(props))
|
||||
.and_then(HelpPageProps::from_boxed_any)
|
||||
.unwrap_or(self.props.clone());
|
||||
|
||||
let page_size = area.height.saturating_sub(6) as usize;
|
||||
|
||||
@@ -122,7 +122,7 @@ where
|
||||
{
|
||||
fn render(&self, frame: &mut ratatui::Frame, _area: Rect, props: Option<Box<dyn Any>>) {
|
||||
let props = props
|
||||
.and_then(|props| WindowProps::from_boxed_any(props))
|
||||
.and_then(WindowProps::from_boxed_any)
|
||||
.unwrap_or(self.props.clone());
|
||||
|
||||
let area = frame.size();
|
||||
@@ -473,7 +473,7 @@ where
|
||||
{
|
||||
fn render(&self, frame: &mut ratatui::Frame, area: Rect, props: Option<Box<dyn Any>>) {
|
||||
let props = props
|
||||
.and_then(|props| BrowsePageProps::from_boxed_any(props))
|
||||
.and_then(BrowsePageProps::from_boxed_any)
|
||||
.unwrap_or(self.props.clone());
|
||||
|
||||
let page_size = area.height.saturating_sub(6) as usize;
|
||||
@@ -758,7 +758,7 @@ where
|
||||
{
|
||||
fn render(&self, frame: &mut ratatui::Frame, area: Rect, props: Option<Box<dyn Any>>) {
|
||||
let props = props
|
||||
.and_then(|props| HelpPageProps::from_boxed_any(props))
|
||||
.and_then(HelpPageProps::from_boxed_any)
|
||||
.unwrap_or(self.props.clone());
|
||||
|
||||
let page_size = area.height.saturating_sub(6) as usize;
|
||||
|
||||
@@ -124,7 +124,7 @@ where
|
||||
{
|
||||
fn render(&self, frame: &mut ratatui::Frame, _area: Rect, props: Option<Box<dyn Any>>) {
|
||||
let props = props
|
||||
.and_then(|props| WindowProps::from_boxed_any(props))
|
||||
.and_then(WindowProps::from_boxed_any)
|
||||
.unwrap_or(self.props.clone());
|
||||
|
||||
let area = frame.size();
|
||||
@@ -505,7 +505,7 @@ where
|
||||
{
|
||||
fn render(&self, frame: &mut ratatui::Frame, area: Rect, props: Option<Box<dyn Any>>) {
|
||||
let props = props
|
||||
.and_then(|props| BrowsePageProps::from_boxed_any(props))
|
||||
.and_then(BrowsePageProps::from_boxed_any)
|
||||
.unwrap_or(self.props.clone());
|
||||
|
||||
let page_size = area.height.saturating_sub(6) as usize;
|
||||
@@ -790,7 +790,7 @@ where
|
||||
{
|
||||
fn render(&self, frame: &mut ratatui::Frame, area: Rect, props: Option<Box<dyn Any>>) {
|
||||
let props = props
|
||||
.and_then(|props| HelpPageProps::from_boxed_any(props))
|
||||
.and_then(HelpPageProps::from_boxed_any)
|
||||
.unwrap_or(self.props.clone());
|
||||
|
||||
let page_size = area.height.saturating_sub(6) as usize;
|
||||
|
||||
Reference in New Issue
Block a user