#rust equivalent to java navigable set

14 messages · Page 1 of 1 (latest)

umbral kestrel
sour fractal
#

it's a bit more generic of an api, as it takes a range and returns an iterator of elements, but set.higher(x) could be done with

set.range(x..).next()
```and `set.lower(x)` with
```rs
set.range(..x).next_back()
umbral kestrel
#

❤️

#

thanks

umbral kestrel
#

it just has an Ord and PartialOrd implementation

sour fractal
umbral kestrel
#

THANK YOU

sour fractal
#

though they do it with integers, which is a bit weird

umbral kestrel
#

yea
the fact that im not using integers confused me in how id use that

trim laurel
#

Range syntax works with anything, you know

#

So segment.. is just fine