mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 10:25:42 +02:00
Fix typos and use more idiomatic assertions (#7755)
I have changed `assert!(a == b)` calls to `assert_eq!(a, b)`, which give better error messages. Similarly for `assert!(a != b)` and `assert_ne!(a, b)`. Basically all instances were comparing primitives (string slices or integers), so there is no loss of generality from special-case macros, I have also fixed a number of typos in comments, variable names, and a few user-facing messages.
This commit is contained in:
@ -387,13 +387,13 @@ where
|
||||
}
|
||||
|
||||
fn maybe_truncate_columns(data: &mut Data, theme: &TableTheme, termwidth: usize) -> bool {
|
||||
const TERMWIDTH_TRESHHOLD: usize = 120;
|
||||
const TERMWIDTH_THRESHOLD: usize = 120;
|
||||
|
||||
if data.count_columns() == 0 {
|
||||
return true;
|
||||
}
|
||||
|
||||
let truncate = if termwidth > TERMWIDTH_TRESHHOLD {
|
||||
let truncate = if termwidth > TERMWIDTH_THRESHOLD {
|
||||
truncate_columns_by_columns
|
||||
} else {
|
||||
truncate_columns_by_content
|
||||
|
@ -7,7 +7,7 @@ pub fn string_width(text: &str) -> usize {
|
||||
pub fn string_wrap(text: &str, width: usize, keep_words: bool) -> String {
|
||||
// todo: change me...
|
||||
//
|
||||
// well... it's not effitient to build a table to wrap a string,
|
||||
// well... it's not efficient to build a table to wrap a string,
|
||||
// but ... it's better than a copy paste (is it?)
|
||||
|
||||
if text.is_empty() {
|
||||
|
Reference in New Issue
Block a user