Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Rust 1.73.0 #2045

Merged
merged 4 commits into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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