Skip to content

Commit

Permalink
Merge pull request #2045 from hannobraun/rust
Browse files Browse the repository at this point in the history
Upgrade to Rust 1.73.0
  • Loading branch information
hannobraun authored Oct 6, 2023
2 parents 70fcd95 + 3c4e075 commit 70e9587
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
6 changes: 6 additions & 0 deletions crates/fj-core/src/algorithms/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ pub struct TransformCache(TypeMap);

impl TransformCache {
fn get<T: 'static>(&mut self, key: &Handle<T>) -> Option<&Handle<T>> {
// Silencing Clippy warning due to false positive in Rust 1.73.0. See:
// https://github.com/rust-lang/rust-clippy/issues/11390#issuecomment-1750951533
#[allow(clippy::unwrap_or_default)]
let map = self
.0
.entry::<BTreeMap<ObjectId, Handle<T>>>()
Expand All @@ -109,6 +112,9 @@ impl TransformCache {
}

fn insert<T: 'static>(&mut self, key: Handle<T>, value: Handle<T>) {
// Silencing Clippy warning due to false positive in Rust 1.73.0. See:
// https://github.com/rust-lang/rust-clippy/issues/11390#issuecomment-1750951533
#[allow(clippy::unwrap_or_default)]
let map = self
.0
.entry::<BTreeMap<ObjectId, Handle<T>>>()
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-core/src/geometry/boundary/single.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl<T: CurveBoundaryElement> Ord for CurveBoundary<T> {

impl<T: CurveBoundaryElement> PartialOrd for CurveBoundary<T> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.inner.partial_cmp(&other.inner)
Some(self.cmp(other))
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/fj-core/src/storage/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl<T> Ord for HandleWrapper<T> {

impl<T> PartialOrd for HandleWrapper<T> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.0.id().partial_cmp(&other.0.id())
Some(self.cmp(other))
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/fj-math/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ impl Eq for Scalar {}

impl PartialOrd for Scalar {
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
self.0.partial_cmp(&other.0)
Some(self.cmp(other))
}
}

impl Ord for Scalar {
fn cmp(&self, other: &Self) -> cmp::Ordering {
// Should never panic, as `from_f64` checks that the wrapped value is
// finite.
self.partial_cmp(other).expect("Invalid `Scalar`")
self.0.partial_cmp(&other.0).expect("Invalid `Scalar`")
}
}

Expand Down
3 changes: 1 addition & 2 deletions crates/fj-viewer/src/viewer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use fj_interop::model::Model;
use fj_math::Aabb;
use tracing::warn;

use crate::{
Expand Down Expand Up @@ -93,7 +92,7 @@ impl Viewer {
.model
.as_ref()
.map(|shape| shape.aabb)
.unwrap_or_else(Aabb::default);
.unwrap_or_default();

self.camera.update_planes(&aabb);

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "1.72.1"
channel = "1.73.0"
components = ["rustfmt", "clippy"]
targets = [
"aarch64-apple-ios",
Expand Down

0 comments on commit 70e9587

Please sign in to comment.