peridot/vendor/github.com/vbauerster/mpb/v7/internal/width.go
2022-07-07 22:13:21 +02:00

11 lines
250 B
Go

package internal
// CheckRequestedWidth checks that requested width doesn't overflow
// available width
func CheckRequestedWidth(requested, available int) int {
if requested < 1 || requested >= available {
return available
}
return requested
}