aloso

joined 1 year ago
[–] aloso@programming.dev 1 points 11 months ago* (last edited 11 months ago)

Thanks!

Piping in a shell script should be doable, it just hasn't been requested yet.

 

l just released a new version of to-html. I created to-html a few years ago for my blog. It is very easy to use: When you want to include the output of a command on a website, run it with to-html:

to-html "cargo clippy"

Then copy and paste the output into your website. to-html comes with some options to customize its output. Starting with this release, you can create a configuration file, so you don't need to repeat the same CLI arguments every time you use to-html. This release also adds shell completions, a way to customize terminal colors via CSS, and a flag to not print the shell prompt. A big thank you to the contributors who implemented these features!

[–] aloso@programming.dev 2 points 1 year ago

It is well supported in all browsers and operating systems. At least VS Code and IntelliJ support it, and even some terminals.

 

Author of Pomsky here. Feel free to ask me anything!

[–] aloso@programming.dev 2 points 1 year ago

I don't understand the "serde2" issue. Isn't "someusername/serde" strictly worse than "serde2"?

GitHub being the only auth provider is something the maintainers wanted to fix, but didn't have enough bandwidth to implement. I think they would welcome contributions!

[–] aloso@programming.dev 7 points 1 year ago* (last edited 1 year ago) (1 children)

If all you do in the Err(e) => ... match arm is returning the error, then you absolutely should use the ? operator instead.

If the match arm also converts the error type into another error type, implement the From trait for the conversion, then you can use ? as well.

If you want to add more information to the error, you can use .map_err(...)?. Or, if you're using the anyhow crate, .with_context(...)?.

[–] aloso@programming.dev 2 points 1 year ago

I can't remember ever needing more than two question marks (??), and even that is very rare in my experience.

[–] aloso@programming.dev 1 points 1 year ago* (last edited 1 year ago) (1 children)

It gives you more type safety, because you use a ProxyᐸFooᐳ instead of just usize.

[–] aloso@programming.dev 0 points 1 year ago (1 children)

Actually, it's not a package repository (it doesn't store crates), it's "just" a website to display metadata from crates published on crates.io. It also shows certain information from docs.rs, GitHub, rustsec.org, etc, and has many useful features that the crates.io website lacks, including a pretty good full-text search.

[–] aloso@programming.dev 6 points 1 year ago

"secure" is relative. They may not be e2e encrypted, but they are still encrypted via TLS, like any HTTPS traffic. It's the same encryption used for online banking. If you care about your instance admin being able to read your messages, you should use Signal or a Matrix client though.

But remember that only a few years ago, almost nobody used e2e encryption, and it wasn't much of an issue.

[–] aloso@programming.dev 2 points 1 year ago

Thank you, too!

[–] aloso@programming.dev 1 points 1 year ago (1 children)

That doesn't solve the issue that there are too few contributors. Requiring a review doesn't ensure that someone reviews the code.

[–] aloso@programming.dev 1 points 1 year ago (3 children)

On GitHub, everybody has the ability to review pull requests, even you. But there still aren't enough volunteers who review PRs.

[–] aloso@programming.dev 2 points 1 year ago (1 children)

Discriminant is irrelevant and you’re not supposed to fuck with it

It matters because the conversion between i32 and the Result is only "free" if they have the same layout (which they do not, because of the discriminant). So a more costly conversion method is required.

And there is zero reason to use unsafe/transmute for this.

You are right, because the compiler is able to optimize your code quite well. However, if that optimization were to break at some point (as there is no guarantee that an optimization will continue to work in the future), it would become less efficient.

view more: next ›