morebagels · @morebagels
3 followers · 8 posts · Server meow.social

another ref sheet for another iterator because clothes are rather fun to draw

#rain #world #rainworld #art #fanart #digitalart #iterator #oc

Last updated 1 year ago

morebagels · @morebagels
3 followers · 6 posts · Server meow.social

silly oc thing of some goons doing a pearl reading together, featuring a friend on discord

#rain #world #rainworld #art #fanart #digitalart #iterator #iterators #oc #gift

Last updated 1 year ago

morebagels · @morebagels
3 followers · 6 posts · Server meow.social
morebagels · @morebagels
1 followers · 3 posts · Server meow.social

iterator of @shromp_ on twt, they're very cool (both iterator and owner) (also i didn't just forget to post this for like. 4 hours. oops)

#rain #world #rainworld #art #fanart #digitalart #oc #iterator #iteratoroc

Last updated 1 year ago

· @dcz
263 followers · 1602 posts · Server fosstodon.org

Ever wanted to use to manipulate images like iterators?

image
.map(to_rgb)
.filter(|r, g, b| b > 100)
.collect();

Well, I don't quite have that, but I do have a -ish library called .

framagit.org/dcz/obraztam

It's -first, it has .map() and .zip() and it optimizes to instructions. Can be easily parallelized even more.

I used it to detect beams in the picture!

#rust #monadic #obraztam #immutable #simd #laser #graphics #monad #iterator

Last updated 2 years ago

Jan :rust: :ferris: · @janriemer
412 followers · 908 posts · Server floss.social

@zkat 😄 No worries 😉

Yeah, totally agree with you, it seems like magic, but I think it is important that we don't see things as magic, when there is a "simple" answer to it, so I've just looked it up.😄

It works (for `Result`), because of the following impl on `FromIterator<T>`:

doc.rust-lang.org/std/iter/tra

And `FromIterator` is used by `collect()`:
doc.rust-lang.org/std/iter/tra

See, no magic, just one of the best type-systems in the world.🙂 :ferris: ❤️

#iterator #typesystem #rustlang #Rust

Last updated 2 years ago

· @dcz
222 followers · 1352 posts · Server fosstodon.org

tip of the day: if you need an uncommon quickly, build it from a closure using `std::iter::from_fn`.

doc.rust-lang.org/std/iter/fn.

```
let mut count = 0;
let counter = std::iter::from_fn(move || {
count += 1;

if count < 6 {
Some(count)
} else {
None
}
});
```

#rust #iterator #rustlang

Last updated 2 years ago

Aljoscha Rittner (beandev) · @beandev
546 followers · 6499 posts · Server social.tchncs.de

Eine schöne Referenz auf Iteratoren in Trait Objects, findet sich hier: depth-first.com/articles/2020/

Die komplexeren Lösungen brauchte ich nicht (und führten in meiner Implementation auch nicht zu schönen Lösungen)

#trait #iterator #rust

Last updated 2 years ago

Aljoscha Rittner (beandev) · @beandev
546 followers · 6499 posts · Server social.tchncs.de

Trait Objects machen einiges etwas komplizierter in . Das fängt schon beim Debuggen an 😕

Und die Welt der ist auch nicht so simpel, wenn man eben nicht nur auf einem Iterator lesen will, sondern eine Kette von Iteratoren hat. Wenn diese aber in Trait Objects weggekapselt sind (und unterschiedliche statische Typen haben), wird das eine echte Herausforderung.

Vermutlich ist es am einfachsten, für jedes Trait-Object einen eigenen Iterator zu implementieren.

Grübel...

#iterator #rust

Last updated 2 years ago