Commit bdf6fb17 authored by Matt Keeler's avatar Matt Keeler Committed by Peter van der meulen

Don’t panic if config contains scale_with_dpi

Insted emit a warning. Note that without the bool::deserialize call the config parser seems to error out and throw away all of the config. Someone more experienced with serde’s internals than myself might know why. Regardless I added that and it fixed it while also having the side effect of quieting clippy regarding not using the input parameter that is passed by value.
parent 1190dab9
......@@ -1806,13 +1806,15 @@ pub struct Font {
scale_with_dpi: Option<()>,
}
fn deserialize_scale_with_dpi<'a, D>(_deserializer: D) -> ::std::result::Result<Option<()>, D::Error>
fn deserialize_scale_with_dpi<'a, D>(deserializer: D) -> ::std::result::Result<Option<()>, D::Error>
where D: de::Deserializer<'a>
{
panic!(
"The `scale_with_dpi` field has been deprecated, \
on X11 the WINIT_HIDPI_FACTOR environment variable can be used instead."
);
// This seems to be necessary in order for the config containing this entry to be parsed properly
let _ignored = bool::deserialize(deserializer);
eprintln!(
"The `scale_with_dpi` setting has been removed, \
on X11 the WINIT_HIDPI_FACTOR environment variable can be used instead.");
Ok(None)
}
fn default_bold_desc() -> FontDescription {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment