Skip to content

Commit

Permalink
make Clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Feb 17, 2024
1 parent 3417308 commit 259a197
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/nu/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub(crate) enum Table {
RowIncompatibleLen(usize, usize, usize),
RowIncompatibleType(usize, String, Type, Type),
RowInvalidKey(usize, String, Vec<String>),
IsTable,
IsValid,
NotAList,
}

Expand Down Expand Up @@ -145,7 +145,7 @@ pub(crate) fn is_table(value: &Value) -> Table {
}
}

Table::IsTable
Table::IsValid
}
_ => Table::NotAList,
}
Expand Down Expand Up @@ -180,7 +180,7 @@ pub(crate) fn is_table(value: &Value) -> Table {
/// }
/// ```
pub(crate) fn transpose(value: &Value) -> Value {
if matches!(is_table(value), Table::IsTable) {
if matches!(is_table(value), Table::IsValid) {
let value_rows = match value {
Value::List { vals, .. } => vals,
_ => return value.clone(),
Expand Down Expand Up @@ -434,7 +434,7 @@ mod tests {
]);
assert_eq!(
is_table(&table),
Table::IsTable,
Table::IsValid,
"{} should be a table",
default_value_repr(&table)
);
Expand All @@ -451,7 +451,7 @@ mod tests {
]);
assert_eq!(
is_table(&table_with_out_of_order_columns),
Table::IsTable,
Table::IsValid,
"{} should be a table",
default_value_repr(&table_with_out_of_order_columns)
);
Expand All @@ -468,7 +468,7 @@ mod tests {
]);
assert_eq!(
is_table(&table_with_nulls),
Table::IsTable,
Table::IsValid,
"{} should be a table",
default_value_repr(&table_with_nulls)
);
Expand All @@ -485,7 +485,7 @@ mod tests {
]);
assert_eq!(
is_table(&table_with_number_colum),
Table::IsTable,
Table::IsValid,
"{} should be a table",
default_value_repr(&table_with_number_colum)
);
Expand Down
4 changes: 2 additions & 2 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ fn render_data<B: Backend>(frame: &mut Frame<'_, B>, app: &App, config: &Config)
});

let table_type = is_table(&value);
let is_a_table = matches!(table_type, crate::nu::value::Table::IsTable);
let is_a_table = matches!(table_type, crate::nu::value::Table::IsValid);

let mut data_frame_height = if config.show_cell_path {
frame.size().height - 2
Expand All @@ -276,7 +276,7 @@ fn render_data<B: Backend>(frame: &mut Frame<'_, B>, app: &App, config: &Config)
i, k, ks
)),
crate::nu::value::Table::NotAList => None,
crate::nu::value::Table::IsTable => unreachable!(),
crate::nu::value::Table::IsValid => unreachable!(),
};

if let Some(msg) = msg {
Expand Down

0 comments on commit 259a197

Please sign in to comment.