vec1 icon indicating copy to clipboard operation
vec1 copied to clipboard

Methods like max still return Option

Open MarcelRobitaille opened this issue 4 years ago • 0 comments

Is it possible for methods like max() to play nicely with a Vec1? Since we know there is at least one element, we should know there is a max.

Vec::max() is strange. It takes an argument. I assume the issue lies in the need to iterate the vector, but maybe there is some workaround.

vec1![1, 2, 3].into_iter().max(); // Some(3)

MarcelRobitaille avatar Dec 21 '21 15:12 MarcelRobitaille