| Crates.io | dbg-ranges |
| lib.rs | dbg-ranges |
| version | 0.1.1 |
| created_at | 2025-01-22 19:53:01.357648+00 |
| updated_at | 2025-01-23 17:05:07.755202+00 |
| description | Helps with debug formatting lists of items that have many sequential items |
| homepage | |
| repository | https://github.com/sivadeilra/dbg-ranges |
| max_upload_size | |
| id | 1527053 |
| size | 12,282 |
This is a simple crate which helps debugging in certain scenarios. Many algorithms rely on lists of items, such as integers, and often these lists contain runs of values that are all "adjacent".
For example, a filesystem implementation might store a list of block numbers that contain the
data for a particular file. If some blocks are allocated sequentially, then there may be
many runs of adjacent values. For example, [42, 100, 101, 102, 103, 104, 20, 31, 32, 33, 34].
It can be helpful to display the runs as ranges, e.g. [42, 100-104, 20, 31-34]. This is more
compact and can help the developer spot patterns in data more quickly.
This crate provides two types that display ranges more compactly, and functions which construct those types.