Skip to content

Commit b5dc350

Browse files
committed
misc: update
1 parent a26e87e commit b5dc350

File tree

7 files changed

+33
-27
lines changed

7 files changed

+33
-27
lines changed

Cargo.toml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tlms"
3-
version = "0.9.0"
4-
edition = "2021"
3+
version = "0.10.0"
4+
edition = "2024"
55

66
[features]
77

@@ -24,6 +24,7 @@ receivers = []
2424

2525
grpc = [
2626
"dep:tonic",
27+
"dep:tonic-prost",
2728
"dep:prost",
2829
]
2930

@@ -36,6 +37,7 @@ telegrams = [
3637
"dep:regex",
3738
"dep:struct-field-names-as-array",
3839
"dep:tonic",
40+
"dep:tonic-prost",
3941
"dep:prost",
4042
"dep:utoipa"
4143
]
@@ -57,25 +59,26 @@ statistics = [
5759
serde_json = "1.0"
5860
serde = {version = "1.0", features = ["derive"]}
5961
chrono = {version = "0.4", features = [ "serde" ]}
60-
uuid = {version = "1.2", features = ["serde", "v4"]}
61-
num-derive = {version = "0.3"}
62+
uuid = {version = "1.18", features = ["serde", "v4"]}
63+
num-derive = {version = "0.4"}
6264

63-
diesel = { version = "2.0", features = ["postgres", "r2d2", "chrono", "uuid"]}
65+
diesel = { version = "2.3", features = ["postgres", "r2d2", "chrono", "uuid"]}
6466

65-
tonic = {version = "0.7", optional = true}
66-
prost = {version = "0.10", optional = true}
67+
tonic = {version = "0.14", optional = true}
68+
tonic-prost = {version = "0.14", optional = true}
69+
prost = { version = "0.14", optional = true}
6770

68-
struct-field-names-as-array = {version = "0.1", optional = true}
71+
struct-field-names-as-array = {version = "0.3", optional = true}
6972
num-traits = {version = "0.2", optional = true}
70-
pbkdf2 = {version = "0.11", optional = true}
71-
rand = {version = "0.8", optional = true}
73+
pbkdf2 = {version = "0.12", optional = true, features = ["simple"]}
74+
rand = {version = "0.9", optional = true}
7275
log = { version = "0.4", optional = true}
73-
regex = {version = "1.7", optional = true}
76+
regex = {version = "1.12", optional = true}
7477

75-
reqwest = {version = "0.11", optional = true, features = ["blocking"]}
76-
utoipa = {version = "3", optional = true}
78+
reqwest = {version = "0.12", optional = true, features = ["blocking"]}
79+
utoipa = {version = "5", optional = true, features = [ "chrono", "uuid"]}
7780

7881
securefmt = { version = "0.1" }
7982

8083
[build-dependencies]
81-
tonic-build = "0.7"
84+
tonic-prost-build = "0.14"

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
fn main() -> Result<(), Box<dyn std::error::Error>> {
2-
tonic_build::compile_protos("proto/telegram.proto")?;
2+
tonic_prost_build::compile_protos("proto/telegram.proto")?;
33
Ok(())
44
}

flake.lock

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

flake.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; };
2+
inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; };
33

44
outputs = { self, nixpkgs }:
55
let
@@ -67,7 +67,8 @@
6767
};
6868

6969
devShells."x86_64-linux".default = pkgs.mkShell {
70-
nativeBuildInputs = with pkgs; [ grpc protobuf websocketpp pkg-config postgresql_14 openssl diesel-cli ];
70+
nativeBuildInputs = with pkgs; [ pkg-config protobuf ];
71+
buildInputs= with pkgs; [ openssl ];
7172
};
7273
};
7374
}

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ pub mod time_serializer {
4444
use serde::{Deserialize, Deserializer, Serialize, Serializer};
4545

4646
/// this is a function that serializes NaiveDateTime as DateTime<Utc> so we also serialize
47-
/// zone information as welll
47+
/// zone information as well
4848
pub fn serialize<S>(time: &NaiveDateTime, serializer: S) -> Result<S::Ok, S::Error>
4949
where
5050
S: Serializer,
5151
{
52-
let time = DateTime::<Utc>::from_utc(*time, Utc);
52+
let time = DateTime::<Utc>::from_naive_utc_and_offset(*time, Utc);
5353

5454
time.serialize(serializer)
5555
}

src/locations/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ impl ApiTransmissionLocation {
152152
if let Ok(epsg_val) = serde_json::from_str(&format!("{{ \"x\":{x}, \"y\":{y} }}")) {
153153
self.properties["epsg3857"] = epsg_val;
154154
} else {
155-
eprintln!("epsg3857 property update skipped: Could not serialize {x} and {y} into json Value!");
155+
eprintln!(
156+
"epsg3857 property update skipped: Could not serialize {x} and {y} into json Value!"
157+
);
156158
}
157159
}
158160
}

src/management/user.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use crate::schema::*;
22

33
use log::warn;
44
use pbkdf2::{
5-
password_hash::{Encoding, PasswordHash, PasswordHasher, PasswordVerifier, SaltString},
65
Pbkdf2,
6+
password_hash::{Encoding, PasswordHash, PasswordHasher, PasswordVerifier, SaltString},
77
};
88
use serde::ser::SerializeStruct;
99
use serde::{Deserialize, Serialize, Serializer};
@@ -13,8 +13,8 @@ use uuid::Uuid;
1313
use diesel::deserialize::{self, FromSql};
1414
use diesel::serialize::{self, Output, ToSql};
1515
use diesel::{
16-
pg::Pg, AsChangeset, AsExpression, ExpressionMethods, FromSqlRow, Identifiable, Insertable,
17-
PgConnection, QueryDsl, Queryable, RunQueryDsl,
16+
AsChangeset, AsExpression, ExpressionMethods, FromSqlRow, Identifiable, Insertable,
17+
PgConnection, QueryDsl, Queryable, RunQueryDsl, pg::Pg,
1818
};
1919
use securefmt::Debug;
2020
use std::collections::HashMap;

0 commit comments

Comments
 (0)