Codebase list golang-github-vbauerster-mpb / 38fe64f internal / width.go
38fe64f

Tree @38fe64f (Download .tar.gz)

width.go @38fe64fraw · history · blame

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
}