Skip to content

input: action set name handling invalid characters, allow string or number in json binding [Halo CEVR] - #406

Open
Mr-Zero88 wants to merge 2 commits into
Supreeeme:mainfrom
Mr-Zero88:halo-cevr
Open

input: action set name handling invalid characters, allow string or number in json binding [Halo CEVR]#406
Mr-Zero88 wants to merge 2 commits into
Supreeeme:mainfrom
Mr-Zero88:halo-cevr

Conversation

@Mr-Zero88

Copy link
Copy Markdown
Contributor

No description provided.

})
use serde::de::{self, Visitor};

struct StringOrTypedVisitor<T>(PhantomData<T>);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate this visitor thing and I think we can avoid doing it, if we just have StringOrTyped be an enum:

#[derive(Deserialize)]
#[serde(untagged)]
enum StringOrTyped<T> {
    String(String)
    Typed(T)
}

and have a method like fn value(&self) -> T

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants