RsvgLength::check_nonnegative(): Take ownership of self

It's Copy, anyway...
parent 5c9b8bb3
......@@ -196,9 +196,9 @@ impl Parse for RsvgLength {
}
impl RsvgLength {
pub fn check_nonnegative (&self) -> Result <RsvgLength, AttributeError> {
pub fn check_nonnegative (self) -> Result <RsvgLength, AttributeError> {
if self.length >= 0.0 {
Ok (*self)
Ok (self)
} else {
Err (AttributeError::Value ("value must be non-negative".to_string ()))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment