diff --git a/src/error.rs b/src/error.rs index 1848dbfba3f9509fa4718ce72994a109a3373c28..1c82552afa5d1456b9f5c92754f9b95f3652dff5 100644 --- a/src/error.rs +++ b/src/error.rs @@ -45,8 +45,9 @@ pub enum TiledError { /// /// [`PropertyValue`]: crate::PropertyValue UnknownPropertyType { - /// The name of the property whose value type is unknown. - name: String + /// The name of the type that isn't recognized by the crate. + /// Supported types are `string`, `int`, `float`, `bool`, `color`, `file` and `object`. + type_name: String }, } @@ -87,8 +88,8 @@ impl fmt::Display for TiledError { ), TiledError::InvalidPropertyValue{description} => write!(fmt, "Invalid property value: {}", description), - TiledError::UnknownPropertyType { name } => - write!(fmt, "Unknown property value type '{}'", name), + TiledError::UnknownPropertyType { type_name } => + write!(fmt, "Unknown property value type '{}'", type_name), } } } diff --git a/src/properties.rs b/src/properties.rs index 5c481f8ae8d0f0b656ed0e8fc91f3fabad7f8f67..8ee944848507db3e53d02f6d783deee136655d1e 100644 --- a/src/properties.rs +++ b/src/properties.rs @@ -116,7 +116,7 @@ impl PropertyValue { }, "file" => Ok(PropertyValue::FileValue(value)), _ => Err(TiledError::UnknownPropertyType { - name: property_type, + type_name: property_type, }), } }