Skip to content

Commit 8bc4104

Browse files
committed
fix x/y not being able to be 0
1 parent 630e975 commit 8bc4104

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "draw-together"
3-
version = "2.0.0"
3+
version = "2.0.1"
44
edition = "2021"
55

66
[[bin]]

src/data.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ impl Data {
133133

134134
file.write_all(&encoded).await.unwrap();
135135
} else {
136-
let self_data = self
137-
.data
138-
.get_or_insert_with(|| Arc::new(Mutex::new(Vec::new())));
136+
let self_data = self.data.as_mut().unwrap();
139137

140138
let mut self_data = self_data.lock().await;
141139
self_data.extend_from_slice(&encoded);

static/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ <h1>draw together!</h1>
157157
const x = buffer[1] | (buffer[2] << 8)
158158
const y = buffer[3] | (buffer[4] << 8)
159159

160-
if (!types[type] || !x || !y || color.length < 7 || !height) throw 'Invalid Format'
160+
if (!types[type] || color.length < 7 || !height) throw 'Invalid Format'
161161

162162
return [types[type], x, y, height, color]
163163
}

0 commit comments

Comments
 (0)