diff --git a/nemo/src/io/parser.rs b/nemo/src/io/parser.rs index a897519a4..737915fba 100644 --- a/nemo/src/io/parser.rs +++ b/nemo/src/io/parser.rs @@ -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()); @@ -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)), ), ]; diff --git a/nemo/src/model/rule_model/map.rs b/nemo/src/model/rule_model/map.rs index ffffe0df6..06352df97 100644 --- a/nemo/src/model/rule_model/map.rs +++ b/nemo/src/model/rule_model/map.rs @@ -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) }