Skip to content
Snippets Groups Projects
Unverified Commit 160db2a6 authored by Alejandro Perea's avatar Alejandro Perea Committed by GitHub
Browse files

Fix docs and rename member (#181)

parent 8ff343f0
No related branches found
No related tags found
No related merge requests found
...@@ -45,8 +45,9 @@ pub enum TiledError { ...@@ -45,8 +45,9 @@ pub enum TiledError {
/// ///
/// [`PropertyValue`]: crate::PropertyValue /// [`PropertyValue`]: crate::PropertyValue
UnknownPropertyType { UnknownPropertyType {
/// The name of the property whose value type is unknown. /// The name of the type that isn't recognized by the crate.
name: String /// Supported types are `string`, `int`, `float`, `bool`, `color`, `file` and `object`.
type_name: String
}, },
} }
...@@ -87,8 +88,8 @@ impl fmt::Display for TiledError { ...@@ -87,8 +88,8 @@ impl fmt::Display for TiledError {
), ),
TiledError::InvalidPropertyValue{description} => TiledError::InvalidPropertyValue{description} =>
write!(fmt, "Invalid property value: {}", description), write!(fmt, "Invalid property value: {}", description),
TiledError::UnknownPropertyType { name } => TiledError::UnknownPropertyType { type_name } =>
write!(fmt, "Unknown property value type '{}'", name), write!(fmt, "Unknown property value type '{}'", type_name),
} }
} }
} }
......
...@@ -116,7 +116,7 @@ impl PropertyValue { ...@@ -116,7 +116,7 @@ impl PropertyValue {
}, },
"file" => Ok(PropertyValue::FileValue(value)), "file" => Ok(PropertyValue::FileValue(value)),
_ => Err(TiledError::UnknownPropertyType { _ => Err(TiledError::UnknownPropertyType {
name: property_type, type_name: property_type,
}), }),
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment