Compare commits

...

3 Commits

Author SHA1 Message Date
Astro d5e2527927 heliwatch: update for newer tokio-xmpp, geo 2023-09-22 19:45:10 +02:00
Astro e419039481 cargo update 2023-09-22 17:52:47 +02:00
Astro 59ead0abad flake.lock: Update
Flake lock file updates:

• Updated input 'fenix':
    'github:nix-community/fenix/51c621ea8f64dafb9d3ce6c98718ca9fee1e05bb' (2023-03-06)
  → 'github:nix-community/fenix/cb59ad177b991978ff571388bf8df6fed32e6bc2' (2023-09-22)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/0a956ec9326eca09725d64d9f1b63896f93505d1' (2023-03-05)
  → 'github:rust-lang/rust-analyzer/d6fef2c7e3be2783369b4b84e320b163b8fd291a' (2023-09-20)
• Updated input 'naersk':
    'github:nmattia/naersk/d998160d6a076cfe8f9741e56aeec7e267e3e114' (2022-12-15)
  → 'github:nmattia/naersk/3f976d822b7b37fc6fb8e6f157c2dd05e7e94e89' (2023-09-07)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/21eda9bc80bef824a037582b1e5a43ba74e92daa' (2023-03-06)
  → 'path:/nix/store/z5r8imp4q5wjfl58d064rwm20cym02c0-source?lastModified=1693844670&narHash=sha256-t69F2nBB8DNQUWHD809oJZJVE%2B23XBrth4QZuVd6IE0%3D&rev=3c15feef7770eb5500a4b8792623e2d6f598c9c1' (2023-09-04)
• Updated input 'utils':
    'github:numtide/flake-utils/3db36a8b464d0c4532ba1c7dda728f4576d6d073' (2023-02-13)
  → 'github:numtide/flake-utils/ff7b65b44d01cf9ba6a71320833626af21126384' (2023-09-12)
• Added input 'utils/systems':
    'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09)
2023-09-22 17:42:14 +02:00
6 changed files with 593 additions and 666 deletions

1191
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -5,3 +5,4 @@ members = [
"http-json",
"collectd-stats",
]
resolver = "2"

View File

@ -8,11 +8,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1678083931,
"narHash": "sha256-RO45RWYuIAej5+0x+NHzrkGJ/9p5/gUGMKFX+lSlJ2I=",
"lastModified": 1695363721,
"narHash": "sha256-+VRVzXpWdSsZPcR2Cg9Q5LKhUQDVvoQFfH4V8iKNAkU=",
"owner": "nix-community",
"repo": "fenix",
"rev": "51c621ea8f64dafb9d3ce6c98718ca9fee1e05bb",
"rev": "cb59ad177b991978ff571388bf8df6fed32e6bc2",
"type": "github"
},
"original": {
@ -28,11 +28,11 @@
]
},
"locked": {
"lastModified": 1671096816,
"narHash": "sha256-ezQCsNgmpUHdZANDCILm3RvtO1xH8uujk/+EqNvzIOg=",
"lastModified": 1694081375,
"narHash": "sha256-vzJXOUnmkMCm3xw8yfPP5m8kypQ3BhAIRe4RRCWpzy8=",
"owner": "nmattia",
"repo": "naersk",
"rev": "d998160d6a076cfe8f9741e56aeec7e267e3e114",
"rev": "3f976d822b7b37fc6fb8e6f157c2dd05e7e94e89",
"type": "github"
},
"original": {
@ -43,12 +43,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1678086707,
"narHash": "sha256-y1uXdxzinIne4FW3TF7DCtxEB9gAbQ4qnbpYzhvkFm8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "21eda9bc80bef824a037582b1e5a43ba74e92daa",
"type": "github"
"lastModified": 1693844670,
"narHash": "sha256-t69F2nBB8DNQUWHD809oJZJVE+23XBrth4QZuVd6IE0=",
"path": "/nix/store/z5r8imp4q5wjfl58d064rwm20cym02c0-source",
"rev": "3c15feef7770eb5500a4b8792623e2d6f598c9c1",
"type": "path"
},
"original": {
"id": "nixpkgs",
@ -66,11 +65,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1678033668,
"narHash": "sha256-Njlus+vY3N++qWE0JXrGjwcXY2QDFuOV/7NruBBMETY=",
"lastModified": 1695220688,
"narHash": "sha256-T54aKrnKMI7Cg2mid5h46mWAXd0xc0pYn0fju3dwXf0=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "0a956ec9326eca09725d64d9f1b63896f93505d1",
"rev": "d6fef2c7e3be2783369b4b84e320b163b8fd291a",
"type": "github"
},
"original": {
@ -80,13 +79,31 @@
"type": "github"
}
},
"utils": {
"systems": {
"locked": {
"lastModified": 1676283394,
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {

View File

@ -75,7 +75,7 @@ impl State {
}
let pos = entry.position()?;
let coord = geo::Coordinate { x: pos.longitude, y: pos.latitude };
let coord = geo::Coord { x: pos.longitude, y: pos.latitude };
if let Some(old_pos) = self.position.replace(pos.clone()) {
if old_pos.longitude != pos.longitude || old_pos.latitude != pos.latitude {
let location = locations.find(&coord);

View File

@ -28,11 +28,11 @@ pub async fn run(jid: String, password: String, muc_jid: String) -> Handle {
};
let (tx, mut rx) = mpsc::channel(1);
let handle = Handle {
room_jid: muc_jid.clone().into(),
room_jid: muc_jid.to_bare(),
tx: tx.clone(),
};
let mut client = AsyncClient::new(&jid, &password).unwrap();
let mut client = AsyncClient::new(Jid::new(&jid).unwrap(), &password);
loop {
match client.next().await {
Some(Event::Online { .. }) => {

View File

@ -24,7 +24,7 @@ impl Location {
}
}
pub fn contains(&self, coord: &geo::Coordinate<f64>) -> bool {
pub fn contains(&self, coord: &geo::Coord<f64>) -> bool {
self.poly.contains(coord)
}
}
@ -54,7 +54,7 @@ impl Locations {
.as_f64().expect("lon f64");
let lat = el.get("lat").expect("lat")
.as_f64().expect("lat f64");
let coord = geo::Coordinate { x: lon, y: lat };
let coord = geo::Coord { x: lon, y: lat };
nodes.insert(id, coord);
}
_ => {}
@ -168,7 +168,7 @@ impl Locations {
}
}
pub fn find(&self, coord: &geo::Coordinate<f64>) -> Option<Arc<String>> {
pub fn find(&self, coord: &geo::Coord<f64>) -> Option<Arc<String>> {
for l in &self.locations {
if l.contains(coord) {
return Some(l.name.clone());