HackerTrans
トップ新着トレンドコメント過去質問紹介求人

jdmnd

no profile record

投稿

[untitled]

1 ポイント·投稿者 jdmnd·2 年前·0 コメント

コメント

jdmnd
·2 か月前·議論
Great news! Related[0]. The presentation video in the linked article from 2002 is a gem.

0: https://news.ycombinator.com/item?id=46266875
jdmnd
·6 か月前·議論
What you're suggesting seems like a spectacular leap. I do not think it is very likely that the unnamed employee at Cloudflare that was micro-optimising code in the DNS resolver is also the author of this RFC, Joe Abley (the current Director of Engineering at the company, and formerly Director of DNS Operations at ICANN).
jdmnd
·4 年前·議論
This is interesting. It looks like there was even some discussion of making this behaviour part of the standard, since it's implemented by all of the major browsers.

https://github.com/whatwg/html/issues/2390
jdmnd
·4 年前·議論
It works for any type that implements the `std::error::Error` trait; which is something you can easily implement for your own types. If you want your errors to be integers for some reason, you can wrap that type in a zero-sized "newtype" wrapper, and implement `Error` for that.

The Stack Overflow answer you linked seems to be claiming that it's simply easier to return strings, but I wouldn't say this is a restriction imposed by the language.