Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Sajjon committed Jan 16, 2024
1 parent e3e6d02 commit becc94a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion profile/src/v100/factors/factor_source_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ pub enum FactorSourceKind {

impl FactorSourceKind {
pub fn discriminant(&self) -> String {
serde_json::to_string(self).expect("Should always be able to JSON encode FactorSourceKind.")
// We do `to_value.as_str` instead of `to_string(_pretty)` to avoid unwanted quotation marks around the string.
serde_json::to_value(self)
.expect("Should always be able to JSON encode FactorSourceKind.")
.as_str()
.expect("Representation should always be string")
.to_owned()
}
}

Expand Down

0 comments on commit becc94a

Please sign in to comment.