From cf784e22d8ffeaf7dc7ddc6112f1940fef58cd6d Mon Sep 17 00:00:00 2001 From: BakerNet Date: Fri, 18 Oct 2024 23:12:35 -0700 Subject: [PATCH] Fix coordinate drift and remove crates.io patch --- Cargo.lock | 122 ++++++++++++++++++++--------------- Cargo.toml | 7 -- web/Cargo.toml | 2 +- web/src/app/profile/stats.rs | 19 +++--- 4 files changed, 82 insertions(+), 68 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 39df4f1..f013825 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -69,7 +69,8 @@ dependencies = [ [[package]] name = "any_spawner" version = "0.1.1" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9747eb01aed7603aba23f7c869d5d7e5d37aab9c3501aced42d8fdb786f1f6e3" dependencies = [ "futures", "thiserror", @@ -479,7 +480,8 @@ dependencies = [ [[package]] name = "const_str_slice_concat" version = "0.1.0" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67855af358fcb20fac58f9d714c94e2b228fe5694c1c9b4ead4a366343eda1b" [[package]] name = "convert_case" @@ -799,7 +801,8 @@ dependencies = [ [[package]] name = "either_of" version = "0.1.0" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6e22feb4d5cacf9f2c64902a1c35ef0f2d766e42db316a98b93992bbce669cb" dependencies = [ "pin-project-lite", ] @@ -1383,8 +1386,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hydration_context" -version = "0.2.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.2.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c1bf20c4d7b63c3b06ba3f39b6db2e99eff55888cbc73375b033c1cf355c9a" dependencies = [ "futures", "js-sys", @@ -1630,8 +1634,9 @@ dependencies = [ [[package]] name = "leptos" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f67de237bdbb6cdb4b97fc32783a7410ec04df8846a24367193f69d14f2ddbe" dependencies = [ "any_spawner", "base64 0.22.1", @@ -1666,9 +1671,9 @@ dependencies = [ [[package]] name = "leptos-use" -version = "0.14.0-beta4" +version = "0.14.0-gamma2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9239da86a154e60a583504baf6c6b55977c4da36a8c0f6a6df06a2f1b99cd59" +checksum = "b8ee56b21556b3f64d9b5f866c7ca4008c20b852b71dc92bc18207b83a789e1c" dependencies = [ "cfg-if", "codee", @@ -1690,15 +1695,14 @@ dependencies = [ [[package]] name = "leptos_axum" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bbaa2a95ff37ffa0a504578af2125d193561306c8d4628f4a007a0ea7f25183" dependencies = [ "any_spawner", "axum", "dashmap", "futures", - "http 1.1.0", - "http-body-util", "hydration_context", "leptos", "leptos_integration_utils", @@ -1707,7 +1711,6 @@ dependencies = [ "leptos_router", "once_cell", "parking_lot", - "serde_json", "server_fn", "tokio", "tower", @@ -1716,8 +1719,9 @@ dependencies = [ [[package]] name = "leptos_config" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f07003f01935ef2fda98562534ac729905e5542e006626d98413183d4dcb70" dependencies = [ "config", "regex", @@ -1728,8 +1732,9 @@ dependencies = [ [[package]] name = "leptos_dom" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "716c834abb1ae19594dfc008138d09a03289cd5b99bd9dc68e1faa09cf24d70d" dependencies = [ "js-sys", "or_poisoned", @@ -1742,8 +1747,9 @@ dependencies = [ [[package]] name = "leptos_hot_reload" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a35daec2869c12c48c095edb855316a97a68b43c28bf9deaf1af86f37b64904e" dependencies = [ "anyhow", "camino", @@ -1759,8 +1765,9 @@ dependencies = [ [[package]] name = "leptos_integration_utils" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19597927587b97a9bb2090090edee5d4158f88a126fcb90cb3a8b3ee15f148b" dependencies = [ "futures", "hydration_context", @@ -1773,8 +1780,9 @@ dependencies = [ [[package]] name = "leptos_macro" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398cf72b3f88e7dfa472eddbc1adf193db966696478f61fa3e98db5f974b859" dependencies = [ "attribute-derive", "cfg-if", @@ -1794,8 +1802,9 @@ dependencies = [ [[package]] name = "leptos_meta" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4aae4080714e5d7e20da1213860acf7829a5150ca2e90e3ef422fb42860d9e6" dependencies = [ "futures", "indexmap", @@ -1809,8 +1818,9 @@ dependencies = [ [[package]] name = "leptos_router" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59123e4fd804110d8c094295f5aa4036372eaf3b9442fd2e9b34f4a69ed69e71" dependencies = [ "any_spawner", "either_of", @@ -1821,11 +1831,9 @@ dependencies = [ "leptos_router_macro", "once_cell", "or_poisoned", - "paste", "percent-encoding", "reactive_graph", "send_wrapper", - "serde", "tachys", "thiserror", "url", @@ -1835,8 +1843,9 @@ dependencies = [ [[package]] name = "leptos_router_macro" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01505eb4ca7978a752f25f8e169bfcf02e6f9d519a70469c42468a1a28043a1a" dependencies = [ "proc-macro-error2", "proc-macro2", @@ -1845,14 +1854,16 @@ dependencies = [ [[package]] name = "leptos_server" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12a11dde60b3ab2e1714b865614d7e94796d051661283252fafb814b244d2815" dependencies = [ "any_spawner", "base64 0.22.1", "codee", "futures", "hydration_context", + "or_poisoned", "reactive_graph", "send_wrapper", "serde", @@ -2144,8 +2155,9 @@ dependencies = [ [[package]] name = "next_tuple" -version = "0.1.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.1.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3269cf6f446d3606787952f4ba564ababaf1b1d9513ccde8baeb160829e63281" [[package]] name = "nom" @@ -2261,7 +2273,8 @@ dependencies = [ [[package]] name = "oco_ref" version = "0.2.0" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64b94982fe39a861561cf67ff17a7849f2cedadbbad960a797634032b7abb998" dependencies = [ "serde", "thiserror", @@ -2326,7 +2339,8 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "or_poisoned" version = "0.1.0" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c04f5d74368e4d0dfe06c45c8627c81bd7c317d52762d118fb9b3076f6420fd" [[package]] name = "overload" @@ -2705,8 +2719,9 @@ dependencies = [ [[package]] name = "reactive_graph" -version = "0.1.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.1.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6be4ea45cd870ff0b31a76ddbddfce767911054c1a92676c667211cacc1290" dependencies = [ "any_spawner", "async-lock", @@ -3228,8 +3243,9 @@ dependencies = [ [[package]] name = "server_fn" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c9a71f0e0dfa29ea8a91af0ab915c83302189d90c475c7242b75a4f3a6ab84" dependencies = [ "axum", "bytes", @@ -3263,8 +3279,9 @@ dependencies = [ [[package]] name = "server_fn_macro" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b06b44c79bc217c1f93ab031f100bb0af50ae25a709e1425fbc38a272db6883" dependencies = [ "const_format", "convert_case", @@ -3276,8 +3293,9 @@ dependencies = [ [[package]] name = "server_fn_macro_default" -version = "0.7.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.7.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "423977ae5d4812892ad112b1212dacaaf3c10f2df8660f4f37c4a489d54ab31c" dependencies = [ "server_fn_macro", "syn 2.0.75", @@ -3738,8 +3756,9 @@ dependencies = [ [[package]] name = "tachys" -version = "0.1.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.1.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06dc40c2abdcc554e22a32a22599375d6b897043af2cd43cf0e92770eb00357b" dependencies = [ "any_spawner", "const_str_slice_concat", @@ -3811,8 +3830,9 @@ dependencies = [ [[package]] name = "throw_error" -version = "0.2.0-gamma" -source = "git+https://github.com/leptos-rs/leptos?rev=699c54e16cea34e4e2353a0f447c4cea02b41b99#699c54e16cea34e4e2353a0f447c4cea02b41b99" +version = "0.2.0-gamma3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be5a9f20fa1c74a4f58ee0399d534d39e01ec4337bc04378578804e6472d667" dependencies = [ "pin-project-lite", ] diff --git a/Cargo.toml b/Cargo.toml index e960a72..d438496 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,10 +30,3 @@ opt-level = 'z' lto = true codegen-units = 1 panic = "abort" - -[patch.crates-io] -leptos = { git = "https://github.com/leptos-rs/leptos", rev = "699c54e16cea34e4e2353a0f447c4cea02b41b99" } -leptos_axum = { git = "https://github.com/leptos-rs/leptos", rev = "699c54e16cea34e4e2353a0f447c4cea02b41b99", optional = true } -leptos_meta = { git = "https://github.com/leptos-rs/leptos", rev = "699c54e16cea34e4e2353a0f447c4cea02b41b99" } -leptos_router = { git = "https://github.com/leptos-rs/leptos", rev = "699c54e16cea34e4e2353a0f447c4cea02b41b99" } -server_fn = { git = "https://github.com/leptos-rs/leptos", rev = "699c54e16cea34e4e2353a0f447c4cea02b41b99" } diff --git a/web/Cargo.toml b/web/Cargo.toml index b988793..0f7f0da 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -24,7 +24,7 @@ leptos = { version = "0.7.0-gamma", features = ["nightly"] } leptos_axum = { version = "0.7.0-gamma", optional = true } leptos_meta = { version = "0.7.0-gamma" } leptos_router = { version = "0.7.0-gamma", features = ["nightly"] } -leptos-use = { version = "0.14.0-beta" } +leptos-use = { version = "0.14.0-gamma" } log = "0.4" nanoid = { version = "0.4", optional = true } oauth2 = { version = "4.4", optional = true } diff --git a/web/src/app/profile/stats.rs b/web/src/app/profile/stats.rs index efa038e..16cf5c4 100644 --- a/web/src/app/profile/stats.rs +++ b/web/src/app/profile/stats.rs @@ -252,13 +252,14 @@ fn parse_stats(stats: &[(bool, i64)]) -> ParsedMode { ), |(mut speed_acc, mut wr_acc, mut speed_series, mut wr_series, mut best_time), (i, (v, s))| { + let x = i + 1; if wr_acc.len() == 10 { wr_acc.pop_front(); } wr_acc.push_back(*v); let ave_wr = wr_acc.iter().copied().filter(|b| *b).count() as f64 / wr_acc.len() as f64 * 100.0; - wr_series.push((i, ave_wr)); + wr_series.push((x, ave_wr)); if *v { if speed_acc.len() == 10 { @@ -267,15 +268,15 @@ fn parse_stats(stats: &[(bool, i64)]) -> ParsedMode { let s = *s as f64; speed_acc.push_back(s); let ave_time = speed_acc.iter().sum::() / speed_acc.len() as f64; - speed_series.push((i, ave_time)); + speed_series.push((x, ave_time)); if best_time.is_empty() { - best_time.push((i, s)); + best_time.push((x, s)); } let prev_best = best_time.last().unwrap().1; if s < prev_best { - best_time.push((i, prev_best)); - best_time.push((i, s)); + best_time.push((x, prev_best)); + best_time.push((x, s)); } } @@ -283,8 +284,8 @@ fn parse_stats(stats: &[(bool, i64)]) -> ParsedMode { }, ); if let Some(best_time_last) = best_time_series.last() { - if best_time_last.0 < winrate_series.len() - 1 { - best_time_series.push((winrate_series.len() - 1, best_time_last.1)); + if best_time_last.0 < winrate_series.len() { + best_time_series.push((winrate_series.len(), best_time_last.1)); } } ParsedMode { @@ -335,8 +336,8 @@ fn draw_chart(canvas: HtmlCanvasElement, mode: GameMode, stats: &ParsedMode) -> .x_label_area_size(35) .y_label_area_size(45) .right_y_label_area_size(45) - .build_cartesian_2d(0usize..len, 0.0..max + 5.0)? - .set_secondary_coord(0usize..len - 1, 0.0..100.0); + .build_cartesian_2d(1usize..len, 0.0..max + 5.0)? + .set_secondary_coord(1usize..len, 0.0..100.0); let drop_decimal_places = |x: &f64| format!("{:.0}", x);