diff --git a/Cargo.toml b/Cargo.toml index 58f4091..91bd982 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,5 @@ +cargo-features = ["profile-rustflags"] + [package] name = "itop" description = "top program, made in iced" @@ -11,8 +13,25 @@ sysinfo = "0.39.6" [dependencies.iced] version = "0.14.0" -features = [ "canvas", "smol" ] +features = ["canvas", "smol"] + +[profile.debug] +debug = true +strip = "none" +debug-assertions = true +overflow-checks = true + +[profile.dev] +opt-level = 3 +rustflags = ["-Clink-arg=-fuse-ld=mold"] + +debug = false +strip = "debuginfo" +debug-assertions = false +overflow-checks = false [profile.release] -lto = true +panic = "abort" codegen-units = 1 +lto = true +strip = "symbols" diff --git a/flake.lock b/flake.lock index 70c7363..1481218 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1790899423, - "narHash": "sha256-THGtz65UGJU+sonZidRboyCMk+9DclpMF7pwL4uDV4M=", + "lastModified": 1793836618, + "narHash": "sha256-TREenflwEjxOSq292FYwbc3kEm7TDRtXCZRNWEdjBmg=", "owner": "ipetkov", "repo": "crane", - "rev": "47b6b27ed9a3a9181415e4367d0c30ab2a0e0250", + "rev": "79fd63528501446749c09f08cad486a58c7d173e", "type": "github" }, "original": { @@ -20,11 +20,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "lastModified": 1791914995, + "narHash": "sha256-Zf/xfQEAasnwnmEfHqW/4hjDE/s44yn2hD4RuVIZRjA=", "owner": "numtide", "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "rev": "b7a79d3fea1e214f6d668d521cecec0c01e26544", "type": "github" }, "original": { @@ -35,11 +35,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1791260994, - "narHash": "sha256-MFBjw66d4h06MvpW6lIl7RwarLteD0sk859CncGwb1Q=", - "rev": "151fa4e8ddfdd8dd25d945ad94ed54a13de9f6e4", + "lastModified": 1794042290, + "narHash": "sha256-VZ8WvA9m3XN36juXyg/GwbDRU2OezOHJlXpJCXkccv0=", + "rev": "f4a03c008967841f2a0b3cb7c436fc6fc31671f6", "type": "tarball", - "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1086391.151fa4e8ddfd/nixexprs.tar.zst?lastModified=1791260994&rev=151fa4e8ddfdd8dd25d945ad94ed54a13de9f6e4" + "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1113206.f4a03c008967/nixexprs.tar.zst?lastModified=1794042290&rev=f4a03c008967841f2a0b3cb7c436fc6fc31671f6" }, "original": { "type": "tarball", diff --git a/flake.nix b/flake.nix index 1c9efff..e17d2c2 100644 --- a/flake.nix +++ b/flake.nix @@ -104,7 +104,10 @@ LD_LIBRARY_PATH = lib.makeLibraryPath dlDeps; inputsFrom = [ crate ]; - packages = [ pkgs.rust-analyzer ]; + packages = with pkgs; [ + rust-analyzer + mold + ]; }; } ); diff --git a/src/app/graph.rs b/src/app/graph.rs index 8a3796a..79a96b7 100644 --- a/src/app/graph.rs +++ b/src/app/graph.rs @@ -35,7 +35,7 @@ impl canvas::Program for Graph { frame.stroke( &canvas::Path::new(|builder| { for (index, value) in self.timeline.iter().enumerate() { - let x = index as f32 / self.timeline.len() as f32 * bounds.width; + let x = index as f32 / (self.timeline.len() - 1) as f32 * bounds.width; let y = bounds.height - value / 100. * bounds.height; builder.line_to(Point::new(x, y)) }