Skip to content

Commit

Permalink
docs: Fix docstrings on ColumnConstraint enums
Browse files Browse the repository at this point in the history
  • Loading branch information
Nukesor committed Jul 8, 2021
1 parent a0a5f6b commit d631d76
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ enum ColumnConstraints {
UpperBoundary(Width),
}
pub enum Boundary {
pub enum Width {
/// Specify a min amount of characters per line for a column.
Fixed(u16),
/// Set a a minimum percentage in respect to table_width for this column.
Expand Down
16 changes: 11 additions & 5 deletions src/style/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/// They allow some control over Column widths as well as the dynamic arrangement process.
///
/// All percental boundaries will be ignored, if:
/// - the terminal width cannot be determined.
/// - you aren't doing dynamic content arrangement.
/// - you aren't using one of ContentArrangement::{Dynamic, DynamicFullWidth}
/// - the width of the table/terminal cannot be determined.
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum ColumnConstraint {
/// This will completely hide a column.
Expand All @@ -24,10 +24,16 @@ pub enum ColumnConstraint {

#[derive(Copy, Clone, Debug, PartialEq)]
pub enum Width {
/// Specify a min amount of characters per line for a column.
/// A fixed amount of characters.
/// This can be used to specify an upper/lower boundary as well as a fixed size for the column.
Fixed(u16),
/// Set a a minimum percentage in respect to table_width for this column.
/// A width equivalent to a certain percentage of the available width.
/// Values above 100 will be automatically reduced to 100.
/// **Warning:** This option will be ignored, if the width cannot be determined!
///
/// This can be used to specify an upper/lower boundary as well as a fixed size for the column.
///
/// **Warning:** This option will be ignored if:
/// - you aren't using one of ContentArrangement::{Dynamic, DynamicFullWidth}
/// - the width of the table/terminal cannot be determined.
Percentage(u16),
}

0 comments on commit d631d76

Please sign in to comment.