Skip to content

Commit 458f5f4

Browse files
committed
refactor(config): fix no features enabled
1 parent 9ea3ba0 commit 458f5f4

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

cosmic-comp-config/src/lib.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,30 @@ pub mod input;
1111
pub mod output;
1212
pub mod workspace;
1313

14+
#[derive(Debug, Deserialize, Serialize, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
15+
pub struct EdidProduct {
16+
pub manufacturer: [char; 3],
17+
pub product: u16,
18+
pub serial: Option<u32>,
19+
pub manufacture_week: i32,
20+
pub manufacture_year: i32,
21+
pub model_year: Option<i32>,
22+
}
23+
24+
#[cfg(feature = "libdisplay-info")]
25+
impl From<libdisplay_info::edid::VendorProduct> for EdidProduct {
26+
fn from(vp: libdisplay_info::edid::VendorProduct) -> Self {
27+
Self {
28+
manufacturer: vp.manufacturer,
29+
product: vp.product,
30+
serial: vp.serial,
31+
manufacture_week: vp.manufacture_week,
32+
manufacture_year: vp.manufacture_year,
33+
model_year: vp.model_year,
34+
}
35+
}
36+
}
37+
1438
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
1539
pub struct KeyboardConfig {
1640
/// Boot state for numlock

cosmic-comp-config/src/output/comp.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,6 @@ use serde::{Deserialize, Serialize};
44
use std::{collections::HashMap, fs::OpenOptions, path::Path};
55
use tracing::{error, warn};
66

7-
#[derive(Debug, Deserialize, Serialize, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
8-
pub struct EdidProduct {
9-
pub manufacturer: [char; 3],
10-
pub product: u16,
11-
pub serial: Option<u32>,
12-
pub manufacture_week: i32,
13-
pub manufacture_year: i32,
14-
pub model_year: Option<i32>,
15-
}
16-
17-
#[cfg(feature = "libdisplay-info")]
18-
impl From<libdisplay_info::edid::VendorProduct> for EdidProduct {
19-
fn from(vp: libdisplay_info::edid::VendorProduct) -> Self {
20-
Self {
21-
manufacturer: vp.manufacturer,
22-
product: vp.product,
23-
serial: vp.serial,
24-
manufacture_week: vp.manufacture_week,
25-
manufacture_year: vp.manufacture_year,
26-
model_year: vp.model_year,
27-
}
28-
}
29-
}
30-
317
#[derive(Debug, Deserialize, Serialize, Clone, PartialEq)]
328
#[serde(rename_all = "lowercase")]
339
pub enum OutputState {

cosmic-comp-config/src/workspace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use serde::{Deserialize, Serialize};
44

5-
use crate::output::comp::EdidProduct;
5+
use crate::EdidProduct;
66

77
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
88
pub struct WorkspaceConfig {

src/config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub mod key_bindings;
4242
mod types;
4343

4444
use cosmic::config::CosmicTk;
45-
pub use cosmic_comp_config::output::comp::EdidProduct;
45+
pub use cosmic_comp_config::EdidProduct;
4646
use cosmic_comp_config::{
4747
input::{DeviceState as InputDeviceState, InputConfig, TouchpadOverride},
4848
output::comp::{

0 commit comments

Comments
 (0)