4 ms·
Cool! I was surprised to see ropey as a dependency, I agree those utility functions should be inlined. I'm currently using ropey to keep the server side state
by afranchuk 5y ago
Cool! I was surprised to see ropey as a dependency, I agree those utility functions should be inlined.
I'm currently using ropey to keep the server side state of documents in an LSP server. I recommend you add at least a slice type, as that's typically desirable. But looks great otherwise!
- josephg 5y agoYeah those utility methods will be inlined anyway by the compiler. But copy+paste (with a comment for attribution) is still probably the right tool here. I like the idea of adding a slice type. What use case do you have in mind for that?
- afranchuk 5y agoI don't know about other people, but my tokenizer is parameterized over string slice types. So I tokenize from a slice (be it &str or ropey's RopeSlice) and some of the returned tokens have subslices. This allows tokenization to do no heap allocation.