Skip to content

Commit

Permalink
Remove destructuring assignment for compatibility with Rust 1.58.1 (#21)
Browse files Browse the repository at this point in the history
* Avoid destructuring assignment for old rustc compatibility.

This syntax was stablized in Rust 1.59.0. Avoid it for now to
support projects with an older minimum-supported rust version.

* github actions: Test against rust 1.58.1 as MSRV

Build against an old release so there's notification when new
code requires a more recent toolchain. This helps enforce a
Minimum Supported Rust Version policy.
  • Loading branch information
rillian authored Sep 19, 2022
1 parent 16b0bad commit 4ee363c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [stable, beta, nightly]
rust: [stable, beta, nightly, 1.58.1]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand Down
4 changes: 3 additions & 1 deletion dotenv/src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ impl<B: BufRead> Iterator for QuotedLines<B> {
if buf.trim_start().starts_with('#') {
return Some(Ok(String::with_capacity(0)));
}
(cur_pos, cur_state) = eval_end_state(cur_state, &buf[buf_pos..]);
let result = eval_end_state(cur_state, &buf[buf_pos..]);
cur_pos = result.0;
cur_state = result.1;

match cur_state {
ParseState::Complete => {
Expand Down

0 comments on commit 4ee363c

Please sign in to comment.