I'm experimenting with #Rust again, and my eyes always bleed with the "lifetime annotation syntax" - why does it have to use an apostrophe 😩 .

&'a mut i32

fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {

impl<'a> System<'a> for LeftWalker {
type SystemData = (ReadStorage<'a, LeftMover>,
WriteStorage<'a, Position>);

But this time I'll try not to rage quit in digust again. I'll stick until this experiment ends. #rustlang

Another one:
- Generics in every language: Vector<MyType>()

- Rust:

Nope:
Vec<u32>::new();

This works:
Vec::<u32>::new();

And this ALSO works:
(Vec <u32)>::new();

So I can't use the universal language of: Vec<u32>::new();

But I can do (Vec <u32)>::new();

#Rust #rustlang

What kind of syntax is that? For the past 28yrs I used more than 12+ langs in every kind of project & the ugliest language I've seen is Rust.

Yes, EVEN UGLIER THAN ERLANG, at least Erlang is consistent and makes sense.

@alfredbaudisch
Where did you got (Vec <u32)>::new() working ???
If this compiles then there is a bug. It does not compile for me in nightly 1.72.0 2023-06-20.

About the needed "::", it's because type and paths are two different things. A method or an associated type implies a path (with all the :: everywhere), but a generic type is just a type.
This seems ugly but it's actually needed to avoid some ambiguous situations where the < > may be interpreted as comparisons.

@alfredbaudisch Maybe you mean (Vec <u32>)::new() with the parenthesis after the ">"?
Then (Vec <u32>) is a type and it can be used to start a path.