TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

An unsafety bug in rust's stdlib

24 点作者 lainon超过 6 年前

1 comment

kristianp超过 6 年前
&gt;&gt; This change takes a concise and clear functional-style implementation and updates it to a long, complex, and apparently buggy imperative-style.<p>&gt;True, but the numbers in the PR indicate that the new version was faster as n grew. I don’t know how often &gt; str::repeat is used, but — and this ties with the point you make about values — when I use standard library functions in Rust, I expect that they be as performant as is possible<p>You&#x27;d think that the same algorithm as in the pull request could be written in a functional style too?