Skip to content

Commit

Permalink
Add comment for future const generic improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbb committed Mar 4, 2023
1 parent f5f93f2 commit 725d177
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions serde_with/src/key_value_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ where
}
}

// TODO Replace this with a const generic string once adt_const_params is stable.
// This will allow something like this.
// The `"id"` part is the field name, which gets converted to/from the map key.
// #[serde_as(as = r#"KeyValueMap<"id", _>"#)]
// Vec<SimpleStruct>,
static MAP_KEY_IDENTIFIER: &str = "$key$";

/// Convert a sequence to a map during serialization.
Expand Down

0 comments on commit 725d177

Please sign in to comment.