Skip to content

Commit 9a38bb9

Browse files
committed
remove crossbeam
1 parent 08caad1 commit 9a38bb9

5 files changed

Lines changed: 13 additions & 20 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ path = "src/bin/main.rs"
2727
[dependencies]
2828
clap = { version = "4", features = ["derive"] }
2929
config = "0.14"
30-
crossbeam-channel = "0.5"
3130
log = { version = "0.4", features = ["serde"] }
3231
lyon = { version = "1", path = "../lyon/crates/lyon" }
3332
malloc_size_of_derive = "0.1"

src/bin/drawing/painter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::num::NonZeroU64;
22
use std::path::Path;
3+
use std::sync::mpsc::{channel, Receiver, TryRecvError};
34
use std::sync::Arc;
45

5-
use crossbeam_channel::{unbounded, Receiver, TryRecvError};
66
use glyphon::{Cache, FontSystem, Resolution, SwashCache, TextAtlas, TextRenderer, Viewport};
77
use nalgebra_glm::{vec2, vec4};
88
use notify::{event::ModifyKind, EventKind, RecommendedWatcher, RecursiveMode, Watcher};
@@ -85,7 +85,7 @@ impl Painter {
8585
label: Some("initial command encoder (loading font atlas, etc)"),
8686
});
8787

88-
let (tx, rx) = unbounded();
88+
let (tx, rx) = channel();
8989

9090
let mut watcher: RecommendedWatcher =
9191
match notify::recommended_watcher(move |res| tx.send(res).unwrap()) {

src/bin/drawing/weather/temperature.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![allow(dead_code)]
22

33
use std::path::Path;
4+
use std::sync::mpsc::{channel, Receiver, TryRecvError};
45

5-
use crossbeam_channel::{unbounded, TryRecvError};
66
use notify::{event::ModifyKind, EventKind, RecommendedWatcher, RecursiveMode, Watcher};
77
use osm::drawing::as_byte_slice;
88
use wgpu::naga::ShaderStage;
@@ -24,7 +24,7 @@ pub struct Temperature {
2424
pipeline: RenderPipeline,
2525
bind_group_layout: BindGroupLayout,
2626
_bind_group: BindGroup,
27-
rx: crossbeam_channel::Receiver<std::result::Result<notify::event::Event, notify::Error>>,
27+
rx: Receiver<std::result::Result<notify::event::Event, notify::Error>>,
2828
_watcher: RecommendedWatcher,
2929
texture: Texture,
3030
}
@@ -35,7 +35,7 @@ impl Temperature {
3535
label: Some("temperature overlay encoder"),
3636
});
3737

38-
let (tx, rx) = unbounded();
38+
let (tx, rx) = channel();
3939

4040
let mut watcher: RecommendedWatcher =
4141
match notify::recommended_watcher(move |res| tx.send(res).unwrap()) {

src/lib/css.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use crossbeam_channel::{unbounded, TryRecvError};
21
use nom::{
32
branch::alt,
43
bytes::complete::{tag, take_while, take_while_m_n},
@@ -13,7 +12,12 @@ use nom::{
1312
AsChar, Err, IResult, InputTakeAtPosition,
1413
};
1514
use notify::{event::ModifyKind, EventKind, RecommendedWatcher, RecursiveMode, Watcher};
16-
use std::{collections::BTreeMap, num::ParseIntError, path::Path};
15+
use std::{
16+
collections::BTreeMap,
17+
num::ParseIntError,
18+
path::Path,
19+
sync::mpsc::{channel, Receiver, TryRecvError},
20+
};
1721

1822
/// Tries to parse an entire stylesheet.
1923
pub fn try_parse_styles(style: &str) -> Option<Vec<Rule>> {
@@ -35,7 +39,7 @@ pub struct RulesCache {
3539
buffer: String,
3640
file_path: String,
3741
pub rules: Vec<Rule>,
38-
rx: crossbeam_channel::Receiver<std::result::Result<notify::event::Event, notify::Error>>,
42+
rx: Receiver<std::result::Result<notify::event::Event, notify::Error>>,
3943
_watcher: RecommendedWatcher,
4044
}
4145

@@ -47,7 +51,7 @@ impl RulesCache {
4751
let buffer: String = std::fs::read_to_string(std::path::Path::new(&file_path))
4852
.expect("Something went wrong reading the file");
4953

50-
let (tx, rx) = unbounded();
54+
let (tx, rx) = channel();
5155
let mut _watcher: RecommendedWatcher =
5256
match notify::recommended_watcher(move |res| tx.send(res).unwrap()) {
5357
Ok(watcher) => watcher,

0 commit comments

Comments
 (0)