strim
This crate provides a single procedural macro that removes all blank lines and leading and trailing whitespace from a string literal.
Rational
Rust's string literals are very convenient to use when it comes to breaking them
into multiple lines by utilising the \
character, e.g.
let string = "\
Hello,\
World!\
";
assert_eq!;
However when one is forced to work with raw-literals, the \
character cannot
be employed anymore to un-break and unindent (i.e. trim) the lines. This is
the main use-case where the strim::trim
macro shines.
use trim;
let string = trim!;
assert_eq!;
Bug Reports and Feature Requests
If you find something that doesn't work as expected and you wish to report it, or if you would like to submit a feature request, please do both of these in the 'issues' section of the original repository on Codeberg.
Development and Contribution
The simplest and quickest way to see the result of your changes is to use the
tests
project included in this repository, i.e.
All invalid cases must produce easy to read, correct, and properly referring
compile errors, i.e. they should underline and complain about the relevant bits
which are incorrect. The tests which result in such compile errors are all
hidden under the compile-errors
feature.
License
Copyright ©2024 Peter Varo
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses.