Skip to content

Commit 5f60aea

Browse files
Remove valuable stuff as tracing-subscriber does not support it
1 parent 4c49899 commit 5f60aea

File tree

6 files changed

+34
-66
lines changed

6 files changed

+34
-66
lines changed

.cargo/config.toml

-2
This file was deleted.

Cargo.lock

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

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ tower-http = { version = "0.5", default-features = false, features = ["tracing",
1111
tokio = { version = "1", features = ["rt-multi-thread", "macros", "signal"] }
1212
tracing-subscriber = { version = "0.3", features = ["json"] }
1313
askama = { version = "0.12", features = ["with-axum"] }
14-
valuable = { version = "0.1", features = ["derive"] }
1514
bustdir = { version = "0.1", features = ["askama"] }
1615
serde = { version = "1", features = ["derive"] }
1716
pyng = { path = "pyng" }

src/main.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use serde::{Deserialize, Serialize};
3232
use tokio::net::TcpListener;
3333
use tower::ServiceBuilder;
3434
use tower_http::services::ServeDir;
35-
use valuable::Valuable;
3635

3736
use crate::{
3837
executor::{ping_bedrock, ping_java},
@@ -71,7 +70,7 @@ async fn main() {
7170
let current_mcstatus: Arc<RwLock<ServicesResponse>> =
7271
Arc::new(RwLock::new(get_mcstatus(http_client.clone()).await));
7372
info!(
74-
status = current_mcstatus.read().as_value(),
73+
status = ?current_mcstatus.read(),
7574
"Got mojang service status"
7675
);
7776
tokio::spawn(refresh_mcstatus(http_client, Arc::clone(&current_mcstatus)));

src/services.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use axum::extract::State;
44
use parking_lot::RwLock;
55
use reqwest::Client;
66
use tokio::{join, select};
7-
use valuable::Valuable;
87

98
use crate::{
109
structures::{
@@ -179,7 +178,7 @@ async fn get_minecraft(client: Client) -> Status {
179178
if data.as_slice() == expected {
180179
Status::Operational
181180
} else {
182-
warn!(expected = ?expected, data = data.as_value(), "Got non-matching Minecraft API data");
181+
warn!(expected = ?expected, ?data, "Got non-matching Minecraft API data");
183182
Status::PossibleProblems
184183
}
185184
}

src/structures.rs

+16-17
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
use std::fmt::{Debug, Display};
22

33
use serde::{Deserialize, Serialize, Serializer};
4-
use valuable::Valuable;
54

6-
#[derive(Serialize, Valuable, Debug, Clone, Copy)]
5+
#[derive(Serialize, Debug, Clone, Copy)]
76
pub struct ServicesResponse {
87
#[serde(rename(serialize = "Xbox services"))]
98
pub xbox: Status,
@@ -15,28 +14,28 @@ pub struct ServicesResponse {
1514
pub minecraft_api: Status,
1615
}
1716

18-
#[derive(Deserialize, Valuable, Clone, Debug)]
17+
#[derive(Deserialize, Clone, Debug)]
1918
#[serde(rename_all = "PascalCase")]
2019
pub struct XblStatusResponse {
2120
pub status: XblStatusStatus,
2221
pub core_services: Vec<XblStatusCoreService>,
2322
pub titles: Vec<XblStatusCoreService>,
2423
}
2524

26-
#[derive(Deserialize, Valuable, Clone, Debug)]
25+
#[derive(Deserialize, Clone, Debug)]
2726
#[serde(rename_all = "PascalCase")]
2827
pub struct XblStatusStatus {
2928
pub overall: XblStatusStatusItem,
3029
}
3130

32-
#[derive(Deserialize, Valuable, Clone, Debug)]
31+
#[derive(Deserialize, Clone, Debug)]
3332
#[serde(rename_all = "PascalCase")]
3433
pub struct XblStatusStatusItem {
3534
pub state: String,
3635
}
3736

3837
#[allow(clippy::module_name_repetitions)]
39-
#[derive(Deserialize, Valuable, Clone, Debug)]
38+
#[derive(Deserialize, Clone, Debug)]
4039
pub struct XblStatusCoreService {
4140
#[serde(rename(deserialize = "Id"))]
4241
pub id: i64,
@@ -46,37 +45,37 @@ pub struct XblStatusCoreService {
4645
pub possible_scenarios: Vec<XblStatusCoreServiceScenario>,
4746
}
4847

49-
#[derive(Deserialize, Valuable, Clone, Debug)]
48+
#[derive(Deserialize, Clone, Debug)]
5049
#[serde(rename_all = "PascalCase")]
5150
pub struct XblStatusCoreServiceScenario {
5251
pub id: i64,
5352
}
5453

55-
#[derive(Deserialize, Valuable, Clone, Debug)]
54+
#[derive(Deserialize, Clone, Debug)]
5655
#[serde(rename_all = "PascalCase")]
5756
pub struct XblStatusCoreServiceStatus {
5857
pub id: i64,
5958
}
6059

61-
#[derive(Deserialize, Valuable, Clone, Debug)]
60+
#[derive(Deserialize, Clone, Debug)]
6261
pub struct MojangSessionServerStatus {
6362
pub id: String,
6463
pub name: String,
6564
}
6665

67-
#[derive(Deserialize, Valuable, Clone, Debug)]
66+
#[derive(Deserialize, Clone, Debug)]
6867
pub struct MojangApiStatus {
6968
pub id: String,
7069
pub name: String,
7170
}
7271

73-
#[derive(Deserialize, Valuable, Clone, Debug, Eq, PartialEq)]
72+
#[derive(Deserialize, Clone, Debug, Eq, PartialEq)]
7473
pub struct MinecraftApiStatusEntry {
7574
pub id: String,
7675
pub name: String,
7776
}
7877

79-
#[derive(Serialize, Deserialize, Valuable, Debug, Clone)]
78+
#[derive(Serialize, Deserialize, Debug, Clone)]
8079
pub struct MCPingResponse {
8180
pub latency: u64,
8281
pub players: Players,
@@ -87,32 +86,32 @@ pub struct MCPingResponse {
8786
pub chat: ChatStatus,
8887
}
8988

90-
#[derive(Serialize, Deserialize, Valuable, Debug, Clone, Copy, Default)]
89+
#[derive(Serialize, Deserialize, Debug, Clone, Copy, Default)]
9190
pub struct ChatStatus {
9291
pub preview: bool,
9392
pub signing: bool,
9493
}
9594

96-
#[derive(Serialize, Deserialize, Valuable, Debug, Clone)]
95+
#[derive(Serialize, Deserialize, Debug, Clone)]
9796
pub struct Version {
9897
pub protocol: i64,
9998
pub broadcast: String,
10099
}
101100

102-
#[derive(Serialize, Deserialize, Valuable, Debug, Clone)]
101+
#[derive(Serialize, Deserialize, Debug, Clone)]
103102
pub struct Players {
104103
pub online: i64,
105104
pub maximum: i64,
106105
pub sample: Vec<PlayerSample>,
107106
}
108107

109-
#[derive(Serialize, Deserialize, Valuable, Debug, Clone)]
108+
#[derive(Serialize, Deserialize, Debug, Clone)]
110109
pub struct PlayerSample {
111110
pub uuid: String,
112111
pub name: String,
113112
}
114113

115-
#[derive(Clone, Copy, Debug, Valuable)]
114+
#[derive(Clone, Copy, Debug)]
116115
pub enum Status {
117116
Operational,
118117
PossibleProblems,

0 commit comments

Comments
 (0)