This fixes a panic when an error starts inside a Unicode code point. The
range is extended to start (or end) at the beginning (or end) of the
character inside which the byte offset is located.
Fixeszkat/miette#223.
An example in README.md makes use of `miette::NamedResult` .
It is imported in the second "example-step", but already used in the first one. Beginners, that copy the example step-by-step to understand it, will run into compile errors, as `NamedResult` was not imported.
* ci: Update actions, replace actions-rs.
* `actions/checkout` is updated from `v1` to the current `v4`.
* `actions-rs/toolchain` is replaced by `dtolnay/rust-toolchain` as
the `actions-rs` actions haven't been maintained in a long time.
* clippy: Remove unnecessary call to `into_iter`.
The parameter takes `IntoIterator`, so we don't have to call
`into_iter` at the call site.
* clippy: Remove explicit lifetime that can be elided.
* clippy: tests: Fix useless conversion warnings.
* clippy: tests: Remove call to `format!`.
* Fix minimal-versions build.
Due to changes in the nightly compiler, using a recent nightly
requires proc-macro2 1.0.60 or later:
https://github.com/dtolnay/proc-macro2/issues/356
* ci: Use is-terminal 0.4.7 for MSRV builds.
is-terminal 0.4.8 updated its MSRV to 1.63, so we can't use it
with our MSRV of 1.56. Force usage of the older version which has
an older MSRV.
This is primarily aimed at making `SourceSpan` and `SourceOffset` usable
in const contexts.
Constifiable functions were found with the
`clippy::missing_const_for_fn` lint, though it reported at least two
false positives.
Fixes: #215
This also changes the behavior with spans including a CRLF line-ending.
Before the panic bug was introduced, these were rendered with the CRLF
being two visual columns wide. Now, any span extending past the EOL is
treated as including one extra visual column.