mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Remove some unnecessary uses of as_slice
For the majority of these cases, `as_slice` can be removed due to `Deref`. In particular, `Deref` for: * `String` -> `str` * `Atom` -> `str` The latter of those two requires, a bump of the locked `string-cache` library
This commit is contained in:
parent
b8ea10bfe3
commit
d838fcce30
19 changed files with 98 additions and 102 deletions
|
@ -52,7 +52,7 @@ impl<'a> CanvasGradientMethods for JSRef<'a, CanvasGradient> {
|
|||
|
||||
self.stops.borrow_mut().push(CanvasGradientStop {
|
||||
offset: (*offset) as f64,
|
||||
color: parse_color(color.as_slice()).unwrap_or(default_black),
|
||||
color: parse_color(&color).unwrap_or(default_black),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue