mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
clippy: Fix unnecessary_cast
warnings in components/script
(#31823)
* clippy: Fix unnecessary cast warnings * clippy: Replace redundant field names with their shorthand alternatives * clippy: Delete struct pattern dereferencings
This commit is contained in:
parent
3e9b808938
commit
bae77671f8
21 changed files with 32 additions and 45 deletions
|
@ -2155,7 +2155,7 @@ impl HTMLInputElement {
|
|||
.map(|time| time.and_utc().timestamp_millis() as f64),
|
||||
InputType::Time => match value.parse_time_string() {
|
||||
Some((hours, minutes, seconds)) => {
|
||||
Some((seconds as f64 + 60.0 * minutes as f64 + 3600.0 * hours as f64) * 1000.0)
|
||||
Some((seconds + 60.0 * minutes as f64 + 3600.0 * hours as f64) * 1000.0)
|
||||
},
|
||||
_ => None,
|
||||
},
|
||||
|
@ -2543,7 +2543,7 @@ impl VirtualMethods for HTMLInputElement {
|
|||
let TextIndexResponse(index) =
|
||||
window.text_index_query(self.upcast::<Node>(), point_in_target);
|
||||
if let Some(i) = index {
|
||||
self.textinput.borrow_mut().set_edit_point_index(i as usize);
|
||||
self.textinput.borrow_mut().set_edit_point_index(i);
|
||||
// trigger redraw
|
||||
self.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage);
|
||||
event.PreventDefault();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue