Pārlūkot izejas kodu

Refactor code: Remove unnecessary blank lines and add debug print statement

Ghastrod 1 gadu atpakaļ
vecāks
revīzija
f436e264b8
4 mainītis faili ar 81 papildinājumiem un 4 dzēšanām
  1. 65 0
      .vscode/launch.json
  2. 0 3
      Cargo.toml
  3. 15 0
      justfile
  4. 1 1
      src/simple_plane.rs

+ 65 - 0
.vscode/launch.json

@@ -0,0 +1,65 @@
+{
+    // Use IntelliSense to learn about possible attributes.
+    // Hover to view descriptions of existing attributes.
+    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        
+        {
+            "type": "lldb",
+            "request": "launch",
+            "name": "Debug unit tests in library 'wgpu1'",
+            "cargo": {
+                "args": [
+                    "test",
+                    "--no-run",
+                    "--lib",
+                    "--package=wgpu1"
+                ],
+                "filter": {
+                    "name": "wgpu1",
+                    "kind": "lib"
+                }
+            },
+            "args": [],
+            "cwd": "${workspaceFolder}"
+        },
+        {
+            "type": "lldb",
+            "request": "launch",
+            "name": "Debug executable 'wgpu1'",
+            "cargo": {
+                "args": [
+                    "build",
+                    "--bin=wgpu1",
+                    "--package=wgpu1"
+                ],
+                "filter": {
+                    "name": "wgpu1",
+                    "kind": "bin"
+                }
+            },
+            "args": [],
+            "cwd": "${workspaceFolder}"
+        },
+        {
+            "type": "lldb",
+            "request": "launch",
+            "name": "Debug unit tests in executable 'wgpu1'",
+            "cargo": {
+                "args": [
+                    "test",
+                    "--no-run",
+                    "--bin=wgpu1",
+                    "--package=wgpu1"
+                ],
+                "filter": {
+                    "name": "wgpu1",
+                    "kind": "bin"
+                }
+            },
+            "args": [],
+            "cwd": "${workspaceFolder}"
+        }
+    ]
+}

+ 0 - 3
Cargo.toml

@@ -15,9 +15,6 @@ opt-level = 3
 [profile.release]
 opt-level = 3
 
-
-
-
 [dependencies]
 cfg-if = "1.0.0"
 winit = "0.29.15"

+ 15 - 0
justfile

@@ -0,0 +1,15 @@
+base:
+  echo 'Just is working'
+
+# this is a comment
+dev:
+  cargo run
+
+check:
+  cargo check
+
+test:
+    cargo test
+
+build:
+    cargo build

+ 1 - 1
src/simple_plane.rs

@@ -54,12 +54,12 @@ pub fn generate_square()->Vec<Vertex>{
 pub fn generate_jamie_plane(dimensions:u32)->Vec<Vertex>{
     let mut vertices: Vec<Vertex> = vec![];
     let nombre_de_points = dimensions * dimensions;
-
     let moitie = dimensions / 2;
     let mut row = 0;
     let mut column = 0;
     while row <= dimensions{
         while column <= dimensions {
+            println!("row: {}, column: {}", row, column);
             let x = column as f32 - moitie as f32;
             let z = row as f32 - moitie as f32;
             let y = 0.0;