burntsushi / blog Goto Github PK
View Code? Open in Web Editor NEWMy blog.
License: The Unlicense
My blog.
License: The Unlicense
Line ~1245:
[I adapted the algorithm from the Hyperscan project to Rust](https://github.com/rust-lang-nursery/regex/blob/master/src/simd_accel/teddy128.rs), and included an extensive write up in the comments if you're interested.
Current: https://github.com/rust-lang/regex/blob/master/src/literal/teddy_ssse3/imp.rs
Or as found earlier in the post: https://github.com/rust-lang-nursery/regex/blob/3de8c44f5357d5b582a80b7282480e38e8b7d50d/src/simd_accel/teddy128.rs
If you'll try to follow
[`utf8-ranges`](https://burntsushi.net/rustdoc/utf8_ranges/)
you'll hit redirect to https://docs.rs/utf8_ranges/ (note the _
), which is 404.
Doing s/_/-/
in the URL fixes this, and I almost created pull request with that very fix, but decided to just report this once I realized that I can also just replace both /rustdoc/ URLs in the text with direct links to docs.rs, and I don't really know what's better. (And if docs.rs is preferred, should links include versions from ripgrep's Cargo.toml at the time of writing, or just redirect to latest versions? Gaaah, I thought this was going to be an easy fix!).
Hi Andrew,
I just wanted to say thank you for the blog post. They were so good and helpful. I have been struggling to grasp rust's concept for quite some time and for the first time I felt like I understand them. Thank you for your time and effort.
I liked your guide to error-handling in Rust. One thing that stumped me for a bit, though, was the file_path_ext_explicit
version of option-ex-string-find
, which I'll paste here for convenience:
fn file_path_ext_explicit(file_path: &str) -> Option<&str> {
match file_name(file_path) {
None => None,
Some(name) => match extension(name) {
None => None,
Some(ext) => Some(ext),
}
}
}
fn file_name(file_path: &str) -> Option<&str> {
// implementation elided
unimplemented!()
}
I understand that you were trying to illustrate the full case analysis without any cleanup, but it really bothered me that the inner match block was a complete no-op, and could have been replaced by Some(name) => extension(name)
. I wonder if comments might help here, perhaps something like:
match file_name(file_path) {
None => None,
Some(name) => match extension(name) { // match to handle Option result
None => None,
Some(ext) => Some(ext) // Re-wrap ext to return an Option
}
}
...perhaps along with some note along the lines of "yes you could get rid of that match, but it's shown for pedagogical purposes here".
It's not a huge thing, but I did spend a bit of time checking if I'd missed something, so anything to indicate "no, it's not your imagination that this is weird" might be nice. :-)
Howdy, hit your blog via HN article on your ripgrep
tool at http://blog.burntsushi.net/ripgrep/ and noticed that your canonical reference is to the non-trailing slash version, which then 301 redirects to the trailing slash version. This could/would hurt the way Google crawls/indexes your content. I thought you'd want to know :)
Hello, I am very impressed by the content you put on your blog but was disappointed that there is no feed that I could subscribe to. If you could provide a feed that my robots could monitor it would be greatly appreciated because I am sure to forget to do so manually.
Thanks, Kevin
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.