Skip to content

Commit

Permalink
enable implicit some feature on query rons. (#897)
Browse files Browse the repository at this point in the history
  • Loading branch information
suaviloquence authored Sep 1, 2024
1 parent 9900692 commit a39dc2b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/query.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::{collections::BTreeMap, sync::Arc};

use ron::extensions::Extensions;
use serde::{Deserialize, Serialize};
use trustfall::TransparentValue;

Expand Down Expand Up @@ -128,7 +129,13 @@ impl SemverQuery {
pub fn all_queries() -> BTreeMap<String, SemverQuery> {
let mut queries = BTreeMap::default();
for (id, query_text) in get_queries() {
let query: SemverQuery = ron::from_str(query_text).unwrap_or_else(|e| {
let mut deserializer = ron::Deserializer::from_str_with_options(
query_text,
ron::Options::default().with_default_extension(Extensions::IMPLICIT_SOME),
)
.expect("Failed to construct deserializer.");

let query = Self::deserialize(&mut deserializer).unwrap_or_else(|e| {
panic!(
"\
Failed to parse a query: {e}
Expand Down

0 comments on commit a39dc2b

Please # to comment.