Skip to content

Commit

Permalink
Pin rust to 1.73 (Workaround Internal Compiler Error) (#1796)
Browse files Browse the repository at this point in the history
* Pin rust to 1.73
- Clippy fixes

* Don't install cargo-watch on CI
  • Loading branch information
HeavenVolkoff committed Nov 17, 2023
1 parent ae31e10 commit f3ad0d7
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-rust/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ inputs.target }}
toolchain: stable
toolchain: '1.73'
components: clippy, rustfmt

- name: Cache Rust Dependencies
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ To run the landing page:

If you encounter any issues, ensure that you are using the following versions of Rust, Node and Pnpm:

- Rust version: **1.70.0**
- Rust version: **1.73.0**
- Node version: **18.17**
- Pnpm version: **8.0.0**

Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "sd-core"
version = "0.1.2"
description = "Virtual distributed filesystem engine that powers Spacedrive."
authors = ["Spacedrive Technology Inc."]
rust-version = "1.70.0"
rust-version = "1.73.0"
license = { workspace = true }
repository = { workspace = true }
edition = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions core/src/api/search/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ impl ObjectFilterArgs {
vec![
not![date_accessed::equals(None)],
match v {
Range::From(v) => date_accessed::gte(v.into()),
Range::To(v) => date_accessed::lte(v.into()),
Range::From(v) => date_accessed::gte(v),
Range::To(v) => date_accessed::lte(v),
},
]
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/api/search/saved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
use specta::Type;
use uuid::Uuid;

use crate::{api::utils::library, invalidate_query, library::Library, prisma::saved_search};
use crate::{api::utils::library, library::Library, prisma::saved_search};

use super::{Ctx, R};

Expand Down Expand Up @@ -111,7 +111,7 @@ pub(crate) fn mount() -> AlphaRouter<Ctx> {
let result: Result<Vec<SavedSearchResponse>, _> = searches
.into_iter()
.map(|search| {
let filters_bytes = search.filters.unwrap_or_else(Vec::new);
let filters_bytes = search.filters.unwrap_or_default();

let filters_string = String::from_utf8(filters_bytes).unwrap();

Check warning on line 116 in core/src/api/search/saved.rs

View workflow job for this annotation

GitHub Actions / clippy

used `unwrap()` on a `Result` value

warning: used `unwrap()` on a `Result` value --> core/src/api/search/saved.rs:116:28 | 116 | let filters_string = String::from_utf8(filters_bytes).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: if this value is an `Err`, it will panic = help: consider using `expect()` to provide a better panic message = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
let filters: Vec<Filter> = serde_json::from_str(&filters_string).unwrap();

Check warning on line 117 in core/src/api/search/saved.rs

View workflow job for this annotation

GitHub Actions / clippy

used `unwrap()` on a `Result` value

warning: used `unwrap()` on a `Result` value --> core/src/api/search/saved.rs:117:34 | 117 | let filters: Vec<Filter> = serde_json::from_str(&filters_string).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: if this value is an `Err`, it will panic = help: consider using `expect()` to provide a better panic message = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_used
Expand Down
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.73"
6 changes: 4 additions & 2 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ case "$(uname)" in
;;
esac

echo "Installing Rust tools..."
cargo install cargo-watch
if [ "${CI:-}" != "true" ]; then
echo "Installing Rust tools..."
cargo install cargo-watch
fi

echo 'Your machine has been setup for Spacedrive development!'

0 comments on commit f3ad0d7

Please sign in to comment.