Skip to content

Commit

Permalink
docs: use doc-comments
Browse files Browse the repository at this point in the history
Some basic cleanup of the code before it is refactored for Pathy 2.
  • Loading branch information
DakshG07 committed Aug 22, 2024
1 parent fa87e8b commit 1d362dd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .direnv/flake-profile
1 change: 0 additions & 1 deletion .direnv/flake-profile-1-link

This file was deleted.

1 change: 1 addition & 0 deletions .direnv/flake-profile-4-link
13 changes: 12 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
};
});
}
11 changes: 7 additions & 4 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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),
}
Expand Down

0 comments on commit 1d362dd

Please sign in to comment.