Skip to content

Commit

Permalink
Rename Key constructors according to API guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
mmarx committed Nov 20, 2023
1 parent d8f6b8e commit 1d69daf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions nemo/src/io/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2335,7 +2335,7 @@ mod test {
);

let ident = "foo";
let key = Key::identifier(Identifier(ident.to_string()));
let key = Key::from_identifier(Identifier(ident.to_string()));

assert_parse!(parser.parse_map_key(), ident, key.clone());

Expand All @@ -2351,11 +2351,11 @@ mod test {

let pairs = vec![
(
Key::string("23".to_string()),
Key::from_string("23".to_string()),
Constant::NumericLiteral(NumericLiteral::Integer(42)),
),
(
Key::identifier(Identifier("foo".to_string())),
Key::from_identifier(Identifier("foo".to_string())),
Constant::NumericLiteral(NumericLiteral::Integer(23)),
),
];
Expand Down
4 changes: 2 additions & 2 deletions nemo/src/model/rule_model/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ pub enum Key {

impl Key {
/// Construct a new [Key] from a [String].
pub fn string(s: String) -> Self {
pub fn from_string(s: String) -> Self {
Self::String(s)
}

/// Construct a new [Key] from an [Identifier].
pub fn identifier(i: Identifier) -> Self {
pub fn from_identifier(i: Identifier) -> Self {
Self::Identifier(i)
}

Expand Down

0 comments on commit 1d69daf

Please sign in to comment.