Skip to content

Commit

Permalink
make the settings table range column no more than 64 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
BohuTANG committed Mar 17, 2024
1 parent 8933dc7 commit a0310bd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/query/storages/system/src/settings_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,16 @@ impl SyncSystemTable for SettingsTable {

// Range Value.
match item.range {
Some(range) => ranges.push(format!("{}", range)),
Some(range) => {
// If the string range is larger than 64, we only show the first 64 characters and add "...".
let range_str = format!("{}", range);
let suffix = if range_str.len() > 64 { "..." } else { "" };
ranges.push(format!(
"{}{}",
range_str.chars().take(64).collect::<String>(),
suffix
));
}
None => ranges.push("None".to_string()),
}

Expand Down

0 comments on commit a0310bd

Please sign in to comment.