Add support for Rust 1.43 (#13)
This commit is contained in:
parent
d95660a260
commit
b1a0b0f8a5
7 changed files with 54 additions and 20 deletions
13
.github/workflows/clippy.yml
vendored
13
.github/workflows/clippy.yml
vendored
|
|
@ -4,10 +4,15 @@ on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Run clippy
|
- uses: actions-rs/toolchain@v1
|
||||||
run: make lint
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
profile: minimal
|
||||||
|
components: clippy, rustfmt
|
||||||
|
override: true
|
||||||
|
- name: Run clippy
|
||||||
|
run: make lint
|
||||||
|
|
|
||||||
13
.github/workflows/rustfmt.yml
vendored
13
.github/workflows/rustfmt.yml
vendored
|
|
@ -4,10 +4,15 @@ on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Run rustfmt
|
- uses: actions-rs/toolchain@v1
|
||||||
run: make format-check
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
profile: minimal
|
||||||
|
components: clippy, rustfmt
|
||||||
|
override: true
|
||||||
|
- name: Run rustfmt
|
||||||
|
run: make format-check
|
||||||
|
|
|
||||||
29
.github/workflows/tests.yml
vendored
29
.github/workflows/tests.yml
vendored
|
|
@ -3,11 +3,30 @@ name: Tests
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-latest:
|
||||||
|
name: Test on Latest
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- name: Test
|
- uses: actions-rs/toolchain@v1
|
||||||
run: make test
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
profile: minimal
|
||||||
|
override: true
|
||||||
|
- name: Test
|
||||||
|
run: make test
|
||||||
|
|
||||||
|
build-stable:
|
||||||
|
name: Test on 1.43.0
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: 1.43.0
|
||||||
|
profile: minimal
|
||||||
|
override: true
|
||||||
|
- name: Test
|
||||||
|
run: make test
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
All notable changes to similar are documented here.
|
All notable changes to similar are documented here.
|
||||||
|
|
||||||
|
## 1.3.0
|
||||||
|
|
||||||
|
* Added support for Rust 1.43.0 for better compatibility.
|
||||||
|
|
||||||
## 1.2.0
|
## 1.2.0
|
||||||
|
|
||||||
* Make the unicode feature optional for inline diffing.
|
* Make the unicode feature optional for inline diffing.
|
||||||
|
|
|
||||||
1
clippy.toml
Normal file
1
clippy.toml
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
msrv = "1.42.0"
|
||||||
|
|
@ -22,10 +22,10 @@ where
|
||||||
D: DiffHook,
|
D: DiffHook,
|
||||||
New::Output: PartialEq<Old::Output>,
|
New::Output: PartialEq<Old::Output>,
|
||||||
{
|
{
|
||||||
if new_range.is_empty() {
|
if new_range.start >= new_range.end {
|
||||||
d.delete(old_range.start, old_range.len(), new_range.start)?;
|
d.delete(old_range.start, old_range.len(), new_range.start)?;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
} else if old_range.is_empty() {
|
} else if old_range.start >= old_range.end {
|
||||||
d.insert(old_range.start, new_range.start, new_range.len())?;
|
d.insert(old_range.start, new_range.start, new_range.len())?;
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ where
|
||||||
New: Index<usize> + ?Sized,
|
New: Index<usize> + ?Sized,
|
||||||
New::Output: PartialEq<Old::Output>,
|
New::Output: PartialEq<Old::Output>,
|
||||||
{
|
{
|
||||||
if old_range.is_empty() || new_range.is_empty() {
|
if old_range.start >= old_range.end || new_range.start >= new_range.end {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
new_range
|
new_range
|
||||||
|
|
@ -141,7 +141,7 @@ where
|
||||||
New: Index<usize> + ?Sized,
|
New: Index<usize> + ?Sized,
|
||||||
New::Output: PartialEq<Old::Output>,
|
New::Output: PartialEq<Old::Output>,
|
||||||
{
|
{
|
||||||
if old_range.is_empty() || new_range.is_empty() {
|
if old_range.start >= old_range.end || new_range.start >= new_range.end {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
new_range
|
new_range
|
||||||
|
|
@ -312,15 +312,15 @@ where
|
||||||
old_range.end -= common_suffix_len;
|
old_range.end -= common_suffix_len;
|
||||||
new_range.end -= common_suffix_len;
|
new_range.end -= common_suffix_len;
|
||||||
|
|
||||||
if old_range.is_empty() && new_range.is_empty() {
|
if old_range.start >= old_range.end && new_range.start >= new_range.end {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
} else if new_range.is_empty() {
|
} else if new_range.start >= new_range.end {
|
||||||
d.delete(
|
d.delete(
|
||||||
old_range.start,
|
old_range.start,
|
||||||
old_range.end - old_range.start,
|
old_range.end - old_range.start,
|
||||||
new_range.start,
|
new_range.start,
|
||||||
)?;
|
)?;
|
||||||
} else if old_range.is_empty() {
|
} else if old_range.start >= old_range.end {
|
||||||
d.insert(
|
d.insert(
|
||||||
old_range.start,
|
old_range.start,
|
||||||
new_range.start,
|
new_range.start,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue