Skip to content

Commit

Permalink
fix #58 by removing unused features
Browse files Browse the repository at this point in the history
  • Loading branch information
ripytide committed Jan 5, 2024
1 parent fac00b8 commit a3a95c5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased - ReleaseDate

### Added

- Support for stable rust (at least stable `v1.75.0`) added by
removing/refactoring unused nightly features.

## 0.7.0 - 2024-01-03

### Added
Expand Down
10 changes: 2 additions & 8 deletions src/interval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,7 @@ pub fn ui<I>(end: I) -> Interval<I>
where
I: PointType,
{
let interval = Interval {
start: I::MIN,
end,
};
let interval = Interval { start: I::MIN, end };

invalid_interval_panic(interval);

Expand Down Expand Up @@ -253,10 +250,7 @@ pub fn iu<I>(start: I) -> Interval<I>
where
I: PointType,
{
let interval = Interval {
start,
end: I::MAX,
};
let interval = Interval { start, end: I::MAX };

invalid_interval_panic(interval);

Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,6 @@ along with nodit. If not, see <https://www.gnu.org/licenses/>.
//! [`NoditMap`]: https://docs.rs/nodit/latest/nodit/map/struct.NoditMap.html
//! [`NoditSet`]: https://docs.rs/nodit/latest/nodit/set/struct.NoditSet.html
#![feature(let_chains)]
#![feature(btree_cursors)]
#![feature(step_trait)]
#![allow(clippy::tabs_in_doc_comments)]
#![allow(clippy::needless_return)]
#![cfg_attr(not(test), no_std)]
Expand Down
37 changes: 21 additions & 16 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,18 +473,25 @@ where
.map(|(key, _)| key)
.copied();

if let Some(left) = left_overlapping
&& let Some(right) = right_overlapping
&& left.start() == right.start()
{
Either::Left(self.cut_single_overlapping(interval, left))
} else {
Either::Right(self.cut_non_single_overlapping(
match (left_overlapping, right_overlapping) {
(Some(left), Some(right)) if left.start() == right.start() => {
Either::Left(self.cut_single_overlapping(interval, left))
}
_ => Either::Right(self.cut_non_single_overlapping(
interval,
left_overlapping,
right_overlapping,
))
)),
}

//todo re-use when let_chains become stable
//
// if let Some(left) = left_overlapping
// && let Some(right) = right_overlapping
// && left.start() == right.start()
// {
// } else {
// }
}
fn cut_single_overlapping<Q>(
&mut self,
Expand Down Expand Up @@ -1854,12 +1861,10 @@ mod tests {
//case zero
for overlap_interval in all_valid_test_bounds() {
//you can't overlap nothing
assert!(
NoditMap::<i8, Interval<i8>, ()>::new()
.overlapping(overlap_interval)
.next()
.is_none()
);
assert!(NoditMap::<i8, Interval<i8>, ()>::new()
.overlapping(overlap_interval)
.next()
.is_none());
}

//case one
Expand Down Expand Up @@ -2494,8 +2499,8 @@ mod tests {

// Test Helper Functions
//======================
fn all_non_overlapping_test_bound_entries()
-> Vec<(Interval<i8>, Interval<i8>)> {
fn all_non_overlapping_test_bound_entries(
) -> Vec<(Interval<i8>, Interval<i8>)> {
let mut output = Vec::new();
for test_bounds1 in all_valid_test_bounds() {
for test_bounds2 in all_valid_test_bounds() {
Expand Down

0 comments on commit a3a95c5

Please sign in to comment.