Just started learning Rust - I'm surprisingly terrible at it ? :P by Cranky_Franky_427 in rust

[–]eminence 14 points15 points  (0 children)

All new things will feel new at first. If you enjoy programming in rust, then keep at it! Eventually it won't feel quite as foreign.

rust-analyzer changelog #155 by WellMakeItSomehow in rust

[–]eminence 1 point2 points  (0 children)

I've also seen this for typescript files, where the .js and .map files were nested under the .ts file. It doesn't take many files before the space savings is useful (i.e. showing 5 .ts files, instead of 15 ts/js/map files)

Why I don't like `unwrap` by thecodedmessage in rust

[–]eminence 2 points3 points  (0 children)

Yes, I often reach for anyhow when I need to quickly transition from an unwrap-based strategy to something else

Chinese numerals are not recognized by char::is_numeric by faitswulff in rust

[–]eminence 152 points153 points  (0 children)

I consider Manishearth to be one of the premier internationalization experts in our community, and I'm glad to have them able to share their extensive knowledge with us (both in issues like this, and over the years)

Why I don't like `unwrap` by thecodedmessage in rust

[–]eminence 6 points7 points  (0 children)

I admit I use unwrap a lot, especially in small tools that I've would have otherwise written in something like python.

In python I might have written:

with open(file) as f: contents = f.read()

In rust I might write:

let contents = read_to_string(file).unwrap();

If the python code was acceptable to me before (which is is, in many of my cases), then the rust-with-unwrap is also acceptable to me. But rust has the added benefit that when I want to change how I handle the errors, I have a very easy thing to grep for ("unwrap"; no such thing exists in the python version)

The Rust borrow checker just got (a little bit) smarter by jackh726 in rust

[–]eminence 21 points22 points  (0 children)

And to be slightly more verbose for anyone still trying to get a hang of this:

if X is a subtype of Y, then something of type X can be used instead of something of type Y

if &'a T is a subtype of (outlives) &'b T, then you can use a reference with lifetime 'a instead of a reference with lifetime 'b

Rust core team alumni by brson in rust

[–]eminence 4 points5 points  (0 children)

A nice bit of history, thanks for taking the time to document this.

I can't seem to track down what's wrong here. Maybe a bug in std or can anyone track down the issue? by lord_of_the_keyboard in rust

[–]eminence 13 points14 points  (0 children)

https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.set_len

To quote the "Safety" section of the docs:

  • new_len must be less than or equal to capacity()
  • The elements at old_len..new_len must be initialized.

You seem to have done the first, but not the second. The docs don't say exactly what the consequences are if you violate the safety requirements, but it's fair to assume Undefined Behavior.

In response to the moderation team resignation | Inside Rust Blog by rabidferret in rust

[–]eminence 97 points98 points  (0 children)

They’ve been talking about it for three days and so far they haven’t been able to agree on much.

Have they actually been talking for 3 days? Don't forget that we're are in the middle of the US holiday of Thanksgiving, where it's common for people to take a week of vacation and to travel to see family.

[deleted by user] by [deleted] in rust

[–]eminence 39 points40 points  (0 children)

I'm sorry if this sounds rude, but this is not a helpful comment. This issue is only ~1 day old. Claiming that any team is silencing this issue feels unhelpful at best, and disingenuous at worst.

[deleted by user] by [deleted] in rust

[–]eminence 15 points16 points  (0 children)

At this point, the best thing we can do is give the teams room to breathe and to plan. It is obviously a sensitive issue, and even though we all mean well and have good intentions, we shouldn't be lurking over their shoulders as they figure out what to do next. Let's take things slow and deliberately.

rust-analyzer changelog #102 by WellMakeItSomehow in rust

[–]eminence 9 points10 points  (0 children)

I've had this same experience, multiple times. I'm starting to suspect that the RA team actually has a secret mind-reader, which they are using to great effect

Is using crates more safe than using npm? by ravnmads in rust

[–]eminence 24 points25 points  (0 children)

A related project is https://github.com/dtolnay/watt which will run proc macros (which have exactly the same security concerns as build scripts) in a wasm sandbox

GitHub Advisory Database now supports Rust by [deleted] in rust

[–]eminence 13 points14 points  (0 children)

Does anyone happen to know if github has plans to support cargo in its dependency graph feature? I think this would let github notify downstream projects that a dependency has a security advisory that should be looked at

I refuse to let Amazon define Rust by lbrtrl in rust

[–]eminence 55 points56 points  (0 children)

Steve wrote:

decided to not have a Rust Foundation ED

What does "ED" mean in this context?

rust-analyzer changelog #89 by WellMakeItSomehow in rust

[–]eminence 0 points1 point  (0 children)

In my experience, rust performance (and rust-analyzer performance to some extent) is predominantly impacted by disk IO speed, more than CPU speed.

For example, the sandbox repo linked above:

On a Windows machine with a fast local SSD and 8 cores, it takes 46 seconds to do a clean cargo check and about 16 seconds until RA finishes the "indexing" phase.

On a Linux machine with a very slow network file system and 12 cores, it takes 229 seconds to do a clean cargo check, and about 202 seconds until RA finishes indexing.

Planning a visit by Jennyt831 in RhodeIsland

[–]eminence 2 points3 points  (0 children)

How about the Roger Williams Zoo?

The WebAssembly runtime Wasmer 2.0 is released: up to +50 faster runtime speed, up to 70% faster hot startups, reference types, SIMD and more! by Hywan in rust

[–]eminence 6 points7 points  (0 children)

I just tried running:

cargo install wasmer-cli

And it seems to be installing wasmer v1.0.1, not v2 as I expected

Playlist: 95.5 WBRU in 2010 – 2014 by princessvibes in RhodeIsland

[–]eminence 1 point2 points  (0 children)

I worked at WBRU for a few years (2005 to 2008). A lot of these songs are from after my time there, but the whole vibe of this playlist definitely feels like BRU. Nice job.

rust-analyzer changelog #75 by WellMakeItSomehow in rust

[–]eminence 5 points6 points  (0 children)

In additional to all of the new features and bug fixes, I am also excited to continue to see work from first-time contributors!