Skip to content

Commit c61ef14

Browse files
committed
Add RUSTFLAGS
1 parent 0d7e537 commit c61ef14

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[target.wasm32-unknown-unknown]
2-
rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""]
2+
rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""]

.github/workflows/pages.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ permissions:
1717
jobs:
1818
build-github-pages:
1919
runs-on: ubuntu-latest
20+
env:
21+
RUSTFLAGS: '--cfg getrandom_backend="wasm_js"'
2022
steps:
2123
- uses: actions/checkout@v4 # repo checkout
2224
- name: Setup toolchain for wasm

.github/workflows/rust.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
check_wasm:
2626
name: Check wasm32
2727
runs-on: ubuntu-latest
28+
env:
29+
RUSTFLAGS: '--cfg getrandom_backend="wasm_js"'
2830
steps:
2931
- uses: actions/checkout@v4
3032
- uses: actions-rs/toolchain@v1
@@ -89,6 +91,8 @@ jobs:
8991
trunk:
9092
name: trunk
9193
runs-on: ubuntu-latest
94+
env:
95+
RUSTFLAGS: '--cfg getrandom_backend="wasm_js"'
9296
steps:
9397
- uses: actions/checkout@v4
9498
- uses: actions-rs/toolchain@v1

crates/octocrab-wasm/src/reqwest_tower_service.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ where
3737
Box<dyn std::future::Future<Output = Result<Self::Response, Self::Error>> + Send>,
3838
>;
3939

40-
fn poll_ready(&mut self, cx: &mut std::task::Context<'_>) -> Poll<Result<(), Self::Error>> {
40+
fn poll_ready(&mut self, _cx: &mut std::task::Context<'_>) -> Poll<Result<(), Self::Error>> {
4141
Poll::Ready(Ok(()))
4242
}
4343

4444
fn call(&mut self, req: http::Request<Body>) -> Self::Future {
4545
let Self {
46-
base_url: base_url,
47-
client: client,
46+
base_url,
47+
client,
4848
} = self.clone();
4949

5050
Box::pin(async move {
@@ -78,7 +78,7 @@ where
7878
.map_err(ReqwestTowerError::BodyError)?
7979
.to_bytes();
8080

81-
let mut uri = parts.uri;
81+
let uri = parts.uri;
8282

8383
let mut uri_parts = uri.into_parts();
8484
if uri_parts.authority.is_none() {

src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use crate::github::model::{GithubArtifactLink, GithubPrLink};
22
pub use crate::loaders::{DataReference, SnapshotLoader};
33
use crate::state::AppState;
44
use eframe::egui::Context;
5-
use std::path::PathBuf;
65

76
pub mod app;
87
mod bar;
@@ -21,9 +20,9 @@ mod viewer;
2120
#[derive(Debug, Clone)]
2221
pub enum DiffSource {
2322
#[cfg(not(target_arch = "wasm32"))]
24-
Files(PathBuf),
23+
Files(std::path::PathBuf),
2524
#[cfg(not(target_arch = "wasm32"))]
26-
Git(PathBuf),
25+
Git(std::path::PathBuf),
2726
Pr(GithubPrLink),
2827
GHArtifact(GithubArtifactLink),
2928
Archive(DataReference),

src/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ fn main() -> eframe::Result<()> {
3333
#[cfg(target_arch = "wasm32")]
3434
fn parse_url_query_params() -> Option<DiffSource> {
3535
use kitdiff::github::auth::parse_github_artifact_url;
36-
use kitdiff::github::pr::parse_github_pr_url;
37-
use octocrab::models::ArtifactId;
3836

3937
if let Some(window) = web_sys::window() {
4038
if let Ok(search) = window.location().search() {

0 commit comments

Comments
 (0)