ropey
A fast and robust text rope for Rust
1.6.1
11M downloads/mo
#3023 most downloaded on crates.io
cessen/ropey
What this package is like to depend on
Last release 1 years ago
02 Aug 2025
Release timing varies
gaps range from 4 weeks to 12 months
Most releases are documented
notes for 30 of 36 stable releases
3 versions withdrawn
withdrawn after publishing
11 years old
44 releases · first in 2015
0 releases in the last 12 months
see the full history below
Release timeline
44 releases · Feb 2015 to Aug 2025Releases
latest 44-
2.0.0-beta.102 Aug 2025 pre-releaseNothing published for this version
-
2.0.0-alpha.301 Jun 2025 pre-releaseNothing published for this version
-
2.0.0-alpha.221 Oct 2024 pre-release -
2.0.0-alpha.120 Oct 2024 pre-release -
1.6.118 Oct 2023Release notes
Open source →- Fixed test code that was incorrect on some platforms / with some configurations.
- Minor documentation improvements.
-
1.6.001 Feb 2023Release notes
Open source →New features
- Added
is_instance()method, which checks if two ropes are same-memory instances of each other.
Bug fixes
- Ropey would panic when trying to create a
Linesiterator for an empty rope or rope slice.
- Added
-
1.5.101 Jan 2023Release notes
Open source →Performance
- A much faster
Linesiterator, thanks to @pascalkuthe (PR #70).
Bug fixes
- Ropey's
Hashimpl was incorrect, due to making incorrect assumptions about the guaranteed behavior ofHashers. This didn't cause any problems with Rust's default hasher, but was incorrect in the general case. - Comparing ropes for equality would panic when the two ropes had chunk boundaries that weren't mutually aligned at char boundaries.
len_lines()could give incorrect counts onRopeSlices that split CRLF pairs.- Ropey's internal B-Tree representation could (rarely) end up in a state that violated some invariants. This didn't affect anything in practice, because no code currently depends on the violated invariant. But future code might.
- A much faster
-
1.5.1-alpha28 Nov 2022 pre-releaseRelease notes
Open source →- Special early release, mainly to accomodate the Helix project. It is not recommended to use this release outside of Helix.
-
1.5.029 May 2022Release notes
Open source →New features
- Added a
reversed()method for Ropey's iterators. This is the same asreverse()except instead of mutating in-place, it consumes the iterator and returns it reversed. This is more convenient when chaining iterator method calls. - Added a
simdcargo feature flag. It's enabled by default, but can be disabled to use only scalar code (no simd intrinsics).
Bug fixes
- Fix a theoretical memory safety issue found via running Ropey's tests through miri. Thanks to @Nilstrieb!
- Fix (unintentionally) depending on Rust memory layout to achieve precise node sizes in memory. We now use
repr(C).
- Added a
-
1.4.117 Mar 2022Release notes
Open source →Bug fixes
- Fix a stupid copy/paste typo in the previous line break feature flag implementation that caused the wrong line break code to be used.
-
1.4.016 Mar 2022 withdrawnRelease notes
Open source →New features
- Added
byte_slice()andget_byte_slice()methods toRopeandRopeSliceto slice by byte index instead of char index. This can allow optimizations in client code in some cases. - Added
cr_linesandunicode_linesfeature flags to the crate, to manage what line endings are recognized and tracked. This allows, for example, building Ropey to only recognize line feed as a line break.unicode_linesis on by default, and corresponds to the original behavior. - Implemented
std::hash::HashforRopeandRopeSlice.
Misc
- Split
str_utilsmodule out into a separate crate,str_indices. Thestr_utilsmodule still exists, but is now mostly just a re-export of the new crate.
- Added
-
1.3.230 Dec 2021Release notes
Open source →Bug fixes
- Relax the lifetime requirements of various
RopeSlicemethods. They were unintentionally strict.
- Relax the lifetime requirements of various
-
1.3.123 Jun 2021Release notes
Open source →Bug fixes
- Fix unnecessary rope fragmentation when using
Rope::append()to append many small ropes together. - Fix contiguous
RopeSlicesoccasionally failing to convert to a&strwithRopeSlice::as_str().
- Fix unnecessary rope fragmentation when using
-
1.3.016 Jun 2021Release notes
Open source →New features
- Added non-panicking versions of all methods on
RopeandRopeSlice. - All iterators can now be reversed, swapping the beheavior of
prev()andnext().
Bug fixes
- The in-memory node size wasn't being computed properly, potentially resulting in unecessary memory fragmentation.
- Added non-panicking versions of all methods on
-
1.2.014 Jun 2020Release notes
Open source →New features
RopeandRopeSlicecan now convert between char indices and utf16 code unit indices. This useful when interacting with external APIs that use utf16 code units as their text indexing scheme.
Dependencies
- Updated smallvec to minimum version 1.0.
-
1.1.001 Sep 2019Release notes
Open source →New features
- Iterators can now be created directly to start at any position in the
RopeorRopeSlice. - All iterators can now iterate backwards via a new
prev()method. - All iterators now implement
CloneandDebugtraits. Bytes,Chars, andLinesiterators now implementExactSizeIterator.
Changes
- The
Chunksiterator no longer yields empty chunks, for example if theRopeorRopeSliceit was created from is also empty.
- Iterators can now be created directly to start at any position in the
-
1.0.101 May 2019Release notes
Open source →Other
- Converted a lot of unsafe code to safe code, with minimal performance impact.
-
1.0.004 Jan 2019Release notes
Open source →New features
- Implemented
Eq,Ord, andPartialOrdtraits forRopeandRopeSlice.
- Implemented
-
0.9.205 Oct 2018Release notes
Open source →Bug fixes
- Turns out the previous Line iterator bug fix introduced a different bug. Fixed!
-
0.9.103 Oct 2018Release notes
Open source →Bug fixes
- The Lines iterator would sometimes emit an extra blank line when created from a small rope slice.
- The
write_to()convenience method could potentially write only part of the rope, without any error indication.
-
0.9.005 Sep 2018Release notes
Open source →Performance improvements
- Minor performance improvements to a few methods on
RopeandRopeSlice.
New features
- Added
Rope::byte()for fetching individual bytes by index. - Added more conversion functions for
RopeandRopeSlice, in the form ofFromimpls.
Breaking changes
- Removed
Rope::to_string(),RopeSlice::from_str(),RopeSlice::to_string(), andRopeSlice::to_rope()in favor ofFromimpls that do the same thing.
- Minor performance improvements to a few methods on
-
0.8.429 Jul 2018Release notes
Open source →Performance improvements
- Minor across-the-board speedups by using SIMD better.
- Significant speedups for Rope::insert()/remove() by being more clever about node info updates.
- Further significant speedup to Rope::remove() due to a (performance-only) bug fix.
Bug fixes
- Ropey wouldn't compile on non-x86/64 platforms after the introduction of SSE2 optimizations in v0.8.3. They are now wrapped properly so that Ropey again compiles on other platforms as well.
-
0.8.326 Jul 2018Release notes
Open source →Performance improvements
- Significant speedups across the board by using SIMD for index conversions.
- Loading texts from files or creating Ropes from strings is now significantly faster.
Memory usage improvements
- Memory overhead reduced from 17% to 10% for freshly loaded text.
Bug fixes
- The low-level line -> byte conversion function would sometimes return a byte index in the middle of the line break for multi-byte line break characters.
-
0.8.222 Jul 2018Release notes
Open source →Performance improvements
- File loading is slightly faster.
Bug fixes
- The low-level line break counting functions could return an incorrect count under certain circumstances. This also affected the higher-level methods in Ropey, although it was somewhat difficult to trigger in practice.
-
0.8.120 Jul 2018Release notes
Open source →Performance improvements
- Increased Rope::insert() speed by roughly 1.4x for small insertion strings.
- Increased Rope::remove() speed by roughly 1.75x.
Other
- General documentation improvements, based on feedback.
-
0.8.015 Jul 2018Release notes
Open source →Performance improvements
- Building new ropes via RopeBuilder or Rope::from_str() is now about 15% faster.
- Slicing is now almost twice as fast.
- Fetching lines is now almost twice as fast.
- Significant speedups for byte/char -> line index conversion methods.
- Significant speedups for line -> byte/char index conversion methods.
New features
- Chunk fetching can now be done by line break index as well as byte/char index.
- Some previously-internal utility functions for working with string slices are now part of Ropey's public API.
- Added Rope::write_to() convenience function for writing a Rope's data to a writer.
Breaking changes
- Conversion from byte/char indices to line indices has been changed to be more intuitive. It is now equivalent to counting the line endings before the given byte/char index.
- Chunk fetching now returns the starting byte/char/line of the chunk, which is generally easier to work with.
-
0.7.110 Jul 2018Release notes
Open source →Bug fixes
- The chunk fetching methods on slices returned bogus starting char indices.
-
0.7.006 Jul 2018Release notes
Open source →Performance improvements
RopeSlices have been given a major speed boost for small slices: for contiguous slices of text in memory, they will simply point at the text without any tree structure. This makes it feasible to useRopeSlices to yield e.g. graphemes or words, even in tight inner loops, while maintaining performance.
New features
- You can now fetch contiguous chunks of text directly from
Ropes andRopeSlices, via byte or char index. The chunk containing the given byte or char will be returned along with offset information. - Added more index conversion methods. For both
Ropes andRopeSlices, you can now convert between any of: byte, char, and line indices. - Added a method to directly create
RopeSlices from string slices. This isn't terribly useful when using Ropey's standard API's, but it allows for much more efficient implementations of things like custom iterators. - Added a method to directly access a
RopeSlices text as a contiguous string slice when possible. This is useful for client code to be able to make a fast-path branch for small slices that happen to be contiguous. Like the above item, this can result in significant performance gains for certain use-cases.
API breaking-changes
- All grapheme related APIs have been removed. However, new APIs have been added that allow the efficient implementation of those same APIs on top of Ropey. See the grapheme examples in the
examplesdirectory of the repo for working implementations.
-
0.6.328 Jan 2018Release notes
Open source →Features
- Added a new
Rope::insert_char()convenience method for inserting a single Unicode scalar value.
Documentation
- Updated the Chunks iterator docs to accurately reflect the new segmentation API in 0.6.x.
- Added a new
-
0.6.211 Jan 2018Release notes
Open source →Fixes
- 0.6.0 and 0.6.1 had an API regression where you now had to specify the segmenter in the type parameters of RopeSlice and the various iterators.
-
0.6.111 Jan 2018 withdrawnRelease notes
Open source →- No functional changes. Just updated the readme to render properly on crates.io.
-
0.6.011 Jan 2018 withdrawnRelease notes
Open source →New features
- Grapheme segmentation can now be customized if needed.
API changes
Rope::remove(),Rope::slice(), andRopeSlice::slice()now take range syntax to specify their ranges.
-
0.5.606 Jan 2018Release notes
Open source →Documenation
- Added a design overview document to the repo, explaining Ropey's design. Mainly targeted at potential contributors.
- Added a more integrated example of usage to the front page of the library docs.
Features
- Fleshed out the
PartialEqimpls.RopeandRopeSlicecan now be compared for equality with not just&str, but alsoStringandCow<str>.
Performance
Rope::char(), which fetches a single Unicode scalar value as achar, is now several times faster.
Misc
- This changelog had the wrong year on some of its dates. Heh...
-
0.5.531 Dec 2017Release notes
Open source →Bug fixes
- Comparing two empty ropes for equality would panic.
New features
- Added Rope::capacity() and Rope::shrink_to_fit() methods. Although these are probably of limited use, they may be useful in especially memory-constrained environments.
-
0.5.430 Dec 2017Release notes
Open source →Bug fixes
- Rope::remove() didn't always merge graphemes between chunks properly.
Performance and memory
- Inserting large texts into a rope now degrades in performance more gracefully as the insertion text becomes larger, rather than hitting a sudden performance cliff.
Rope::remove()got a nice speed boost.- Memory overhead has been reduced across the board. Freshly loaded files now only have ~17% overhead, and the worst-case (built up from lots of small random-location inserts) is now ~60% overhead.
Misc
- 100% unit test coverage of public APIs.
- Added randomized testing via QuickCheck.
- Added benchmarks to the library.
-
0.5.328 Dec 2017Release notes
Open source →Performance and memory
- Massive speed boost for small insertions: between %40 - %50 faster.
Rope::from_str()now only uses stack memory for strings smaller than ~3MB. (Aside from the resulting Rope itself, of course.)
Misc
- Better unit test coverage of public APIs. Still not 100%, but getting there!
-
0.5.225 Dec 2017Release notes
Open source →Bug fixes
- There were ocassionally unnecessary heap allocations that took up a small amount of extra space in the rope.
Misc
- Memory overhead has been significantly reduced for ropes built up by many small coherent insertions.
-
0.5.124 Dec 2017Release notes
Open source →Bug fixes
- Calling
Rope::line_to_char()with a line index one-past-the-end would panic. This wasn't consistent with other indexing, and has been fixed and now returns the one-past-the-end char index. - Had accidentally left some asserts in the
Rope::remove()code that were put in during debugging. They were causing significant slow downs for removes.
Misc
- Added a changelog file.
- Calling
-
0.5.023 Dec 2017Nothing published for this version
-
0.4.122 Dec 2017Nothing published for this version
-
0.4.022 Dec 2017Nothing published for this version
-
0.3.011 Apr 2015Nothing published for this version
-
0.2.003 Mar 2015Nothing published for this version
-
0.1.026 Feb 2015Nothing published for this version