Merge #44 44: Scope trait TextLen just for primitives r=matklad a=CAD97 As an alternative to #41 I thought I posted this already.... Co-authored-by: CAD97 <cad97@cad97.com>
diff --git a/README.md b/README.md index 482a055..365b602 100644 --- a/README.md +++ b/README.md
@@ -1,13 +1,13 @@ -# text_unit +# text-size -[](https://travis-ci.org/matklad/text_unit) -[](https://crates.io/crates/text_unit) -[](https://docs.rs/text_unit/) +[](https://travis-ci.org/matklad/text-size) +[](https://crates.io/crates/text-size) +[](https://docs.rs/text-size/) A library that provides newtype wrappers for `u32` and `(u32, u32)` for use as text offsets. -See the [docs](https://docs.rs/text_unit/) for more. +See the [docs](https://docs.rs/text-size/) for more. ## License
diff --git a/src/lib.rs b/src/lib.rs index 07dc5e8..92bd36b 100644 --- a/src/lib.rs +++ b/src/lib.rs
@@ -1,17 +1,17 @@ //! Newtypes for working with text sizes/ranges in a more type-safe manner. //! //! This library can help with two things: -//! * Reducing storage requirenments for offsets and ranges, under the +//! * Reducing storage requirements for offsets and ranges, under the //! assumption that 32 bits is enough. //! * Providing standard vocabulary types for applications where text ranges //! are pervasive. //! //! However, you should not use this library simply because you work with -//! strings. In the overhelming majority of cases, using `usize` and +//! strings. In the overwhelming majority of cases, using `usize` and //! `std::ops::Range<usize>` is better. In particular, if you are publishing a //! library, using only std types in the interface would make it more //! interoperable. Similarly, if you are writing something like a lexer, which -//! produces, but does not *store* text ranges, than sticking to `usize` would +//! produces, but does not *store* text ranges, then sticking to `usize` would //! be better. //! //! Minimal Supported Rust Version: latest stable.