From 1d362dd6f8cb89d3721c3079017f269e0935c92f Mon Sep 17 00:00:00 2001 From: Daksh Gupta Date: Thu, 22 Aug 2024 17:09:26 -0400 Subject: [PATCH] docs: use doc-comments Some basic cleanup of the code before it is refactored for Pathy 2. --- .direnv/flake-profile | 2 +- .direnv/flake-profile-1-link | 1 - .direnv/flake-profile-4-link | 1 + flake.nix | 13 ++++++++++++- src/app.rs | 11 +++++++---- 5 files changed, 21 insertions(+), 7 deletions(-) delete mode 120000 .direnv/flake-profile-1-link create mode 120000 .direnv/flake-profile-4-link diff --git a/.direnv/flake-profile b/.direnv/flake-profile index 0c05709..e289079 120000 --- a/.direnv/flake-profile +++ b/.direnv/flake-profile @@ -1 +1 @@ -flake-profile-1-link \ No newline at end of file +flake-profile-4-link \ No newline at end of file diff --git a/.direnv/flake-profile-1-link b/.direnv/flake-profile-1-link deleted file mode 120000 index a26c44e..0000000 --- a/.direnv/flake-profile-1-link +++ /dev/null @@ -1 +0,0 @@ -/nix/store/wmppc46w1d8pr8dgdn6q3g58fi5l9fj7-nix-shell-env \ No newline at end of file diff --git a/.direnv/flake-profile-4-link b/.direnv/flake-profile-4-link new file mode 120000 index 0000000..4debc65 --- /dev/null +++ b/.direnv/flake-profile-4-link @@ -0,0 +1 @@ +/nix/store/6wvzz0b0zd6gagdww6s8241zsv21z50g-nix-shell-env \ No newline at end of file diff --git a/flake.nix b/flake.nix index 83e11e9..255c242 100644 --- a/flake.nix +++ b/flake.nix @@ -13,13 +13,24 @@ inherit system; }; in { - devShells.default = pkgs.mkShell { + devShells.default = pkgs.mkShell rec { # Additional dev-shell environment variables can be set directly # MY_CUSTOM_DEVELOPMENT_VAR = "something else"; nativeBuildInputs = with pkgs; [ trunk + rust-analyzer ]; + buildInputs = with pkgs; [ + libxkbcommon + libGL + xorg.libX11 + wayland + xorg.libXrandr + xorg.libXcursor + xorg.libXi + ]; + LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath buildInputs}"; }; }); } diff --git a/src/app.rs b/src/app.rs index 81e1a55..9bebc0a 100644 --- a/src/app.rs +++ b/src/app.rs @@ -27,11 +27,14 @@ macro_rules! console_log { ($($t:tt)*) => (log(&format_args!($($t)*).to_string())) } // */ + #[derive(serde::Deserialize, serde::Serialize)] #[serde(default)] // if we add new fields, give them default values when deserializing old state +/// A class containing the current state of Pathy. pub struct PathyApp { - // this how you opt-out of serialization of a member - //#[serde(skip)] + // This how you opt-out of serialization of a member + // #[serde(skip)] + // This will prevent said member from being saved pub height: f32, // Height of field pub width: f32, // Width of field pub scale: f32, // Scale to display @@ -45,8 +48,8 @@ pub struct PathyApp { } #[derive(serde::Deserialize, serde::Serialize, Eq, PartialEq)] +/// Represents possible Cursor modes pub enum CursorMode { - // Represent possible cursor modes Default, // No action Create, // Create new nodes and paths Edit, // Edit the positioning of points @@ -55,8 +58,8 @@ pub enum CursorMode { } #[derive(serde::Deserialize, serde::Serialize, Clone)] +/// Represents movements for the robot to take pub enum Process { - // Represents movements for the robot to take Drive(i32), Turn(i32), }