mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
clippy: Fix a bunch of warnings in script
(#32680)
This is just a portion of the errors that are remaining to be fixed.
This commit is contained in:
parent
93fdb8263d
commit
26624a109f
27 changed files with 150 additions and 113 deletions
|
@ -25,26 +25,26 @@ pub struct ConstantSpec {
|
|||
#[allow(dead_code)]
|
||||
pub enum ConstantVal {
|
||||
/// `long` constant.
|
||||
IntVal(i32),
|
||||
Int(i32),
|
||||
/// `unsigned long` constant.
|
||||
UintVal(u32),
|
||||
Uint(u32),
|
||||
/// `double` constant.
|
||||
DoubleVal(f64),
|
||||
Double(f64),
|
||||
/// `boolean` constant.
|
||||
BoolVal(bool),
|
||||
Bool(bool),
|
||||
/// `null` constant.
|
||||
NullVal,
|
||||
Null,
|
||||
}
|
||||
|
||||
impl ConstantSpec {
|
||||
/// Returns a `JSVal` that represents the value of this `ConstantSpec`.
|
||||
pub fn get_value(&self) -> JSVal {
|
||||
match self.value {
|
||||
ConstantVal::NullVal => NullValue(),
|
||||
ConstantVal::IntVal(i) => Int32Value(i),
|
||||
ConstantVal::UintVal(u) => UInt32Value(u),
|
||||
ConstantVal::DoubleVal(d) => DoubleValue(d),
|
||||
ConstantVal::BoolVal(b) => BooleanValue(b),
|
||||
ConstantVal::Null => NullValue(),
|
||||
ConstantVal::Int(i) => Int32Value(i),
|
||||
ConstantVal::Uint(u) => UInt32Value(u),
|
||||
ConstantVal::Double(d) => DoubleValue(d),
|
||||
ConstantVal::Bool(b) => BooleanValue(b),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue