Mike Burr - log

[wip][rust] All those little squigglies

TODO: write an article about all the many terse, mind-bending use of single, non alnum characters to express rust ideas:

&*foobar
!Trait foobar
fn foo(bar: impl Jim)

fn foo(x: &mut Thing) vs fn foo(mut x: Thing)

for i in 0..=n{} // what that eq sign?

thing! vs !thing -- yeah, they're way different

*const foo -- I'm still not sure what this is

foo* -- sheet, I haven't seen this. do we nee to be on the lookout for it?

'foo -- a single, unbalanced single-quote? that's right!!

Foo<'_> -- why this? what exactly does this say about a type?

...it's endless, but there's a lot of material and my own summarization would help me.

Say, what could this mean? -- 0.0..1.0


TIL, at this many years old...

fn complex_system(
    // Did you know about this shit?
    (a, mut b): (Res<ResourceA>, ResMut<ResourceB>)
) { ... }

I you paste *foo in front of *foo and then let you auto-formatter do its thing, you will end up with *foo * foo ... which is wrong in a different way than you might expect if you're not paying attention.


Why is it weird and/or wrong to put a & in front of mut here

for (mut visibility, &ar_element) in ar_query.iter_mut() { ... }

What is this?! Did we find another species of squiggly? (the octothorp)