diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3956345..eaf8f8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest, windows-latest] - rust: [stable, 1.64.0] + rust: [stable, 1.65.0] steps: - name: Install Rust uses: hecrj/setup-rust-action@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index fb3688f..b35b99e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ file is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Requires Rust 1.65 or later. + ## [0.6.0] - 2023-08-07 ### Changed @@ -85,6 +91,7 @@ Versioning](https://semver.org/spec/v2.0.0.html). - The [OPTICS](https://en.wikipedia.org/wiki/OPTICS_algorithm) clustering algorithm. +[Unreleased]: https://github.com/petabi/petal-clustering/compare/0.6.0...main [0.6.0]: https://github.com/petabi/petal-clustering/compare/0.5.1...0.6.0 [0.5.1]: https://github.com/petabi/petal-clustering/compare/0.5.0...0.5.1 [0.5.0]: https://github.com/petabi/petal-clustering/compare/0.4.0...0.5.0 diff --git a/Cargo.toml b/Cargo.toml index 6eeae85..3526807 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "petal-clustering" version = "0.6.0" edition = "2021" -rust-version = "1.64" +rust-version = "1.65" description = "A collection of clustering algorithms." readme = "README.md" documentation = "https://docs.rs/petal-clustering" diff --git a/src/optics.rs b/src/optics.rs index f51db55..1079325 100644 --- a/src/optics.rs +++ b/src/optics.rs @@ -91,9 +91,9 @@ where if clusters.is_empty() { outliers.push(id); } else { - let v = clusters - .get_mut(&(clusters.len() - 1)) - .expect("cluster map crashed"); + let Some(v) = clusters.get_mut(&(clusters.len() - 1)) else { + unreachable!("`clusters` is not empty and its key is a sequence number"); + }; v.push(id); } } else {