Skip to content

Commit 06dfcb5

Browse files
committed
tests: Fix warnings from clippy::legacy_numeric_constants
1 parent 2e6981b commit 06dfcb5

5 files changed

Lines changed: 16 additions & 16 deletions

File tree

graphql/src/store/query.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,8 @@ mod tests {
738738
&object,
739739
BLOCK_NUMBER_MAX,
740740
field,
741-
std::u32::MAX,
742-
std::u32::MAX,
741+
u32::MAX,
742+
u32::MAX,
743743
&INPUT_SCHEMA,
744744
)
745745
.unwrap()
@@ -1042,8 +1042,8 @@ mod tests {
10421042
&object,
10431043
BLOCK_NUMBER_MAX,
10441044
&query_field,
1045-
std::u32::MAX,
1046-
std::u32::MAX,
1045+
u32::MAX,
1046+
u32::MAX,
10471047
&INPUT_SCHEMA,
10481048
);
10491049

@@ -1100,8 +1100,8 @@ mod tests {
11001100
&object,
11011101
BLOCK_NUMBER_MAX,
11021102
&query_field,
1103-
std::u32::MAX,
1104-
std::u32::MAX,
1103+
u32::MAX,
1104+
u32::MAX,
11051105
&INPUT_SCHEMA,
11061106
);
11071107

@@ -1194,8 +1194,8 @@ mod tests {
11941194
&object,
11951195
BLOCK_NUMBER_MAX,
11961196
&query_field,
1197-
std::u32::MAX,
1198-
std::u32::MAX,
1197+
u32::MAX,
1198+
u32::MAX,
11991199
&INPUT_SCHEMA,
12001200
);
12011201

runtime/test/src/test/abi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,13 @@ async fn test_abi_store_value(api_version: Version) {
342342
assert_eq!(new_value, Value::from(string));
343343

344344
// Value::Int
345-
let int = i32::min_value();
345+
let int = i32::MIN;
346346
let new_value_ptr = instance.takes_val_returns_ptr("value_from_int", int).await;
347347
let new_value: Value = instance.asc_get(new_value_ptr).unwrap();
348348
assert_eq!(new_value, Value::Int(int));
349349

350350
// Value::Int8
351-
let int8 = i64::min_value();
351+
let int8 = i64::MIN;
352352
let new_value_ptr = instance
353353
.takes_val_returns_ptr("value_from_int8", int8)
354354
.await;

store/test-store/tests/graphql/introspection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ async fn introspection_query(schema: Arc<ApiSchema>, query: &str) -> QueryResult
122122
let options = QueryExecutionOptions {
123123
resolver: MockResolver,
124124
deadline: None,
125-
max_first: std::u32::MAX,
126-
max_skip: std::u32::MAX,
125+
max_first: u32::MAX,
126+
max_skip: u32::MAX,
127127
trace: false,
128128
};
129129

store/test-store/tests/postgres/relational.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ lazy_static! {
182182
InputSchema::parse_latest(THINGS_GQL, THINGS_SUBGRAPH_ID.clone())
183183
.expect("failed to parse schema");
184184
static ref NAMESPACE: Namespace = Namespace::new("sgd0815".to_string()).unwrap();
185-
static ref LARGE_INT: BigInt = BigInt::from(std::i64::MAX).pow(17).unwrap();
185+
static ref LARGE_INT: BigInt = BigInt::from(i64::MAX).pow(17).unwrap();
186186
static ref LARGE_DECIMAL: BigDecimal =
187187
BigDecimal::from(1) / BigDecimal::new(LARGE_INT.clone(), 1);
188188
static ref BYTES_VALUE: H256 = H256::from(hex!(
@@ -200,8 +200,8 @@ lazy_static! {
200200
entity! { THINGS_SCHEMA =>
201201
id: "one",
202202
bool: true,
203-
int: std::i32::MAX,
204-
int8: std::i64::MAX,
203+
int: i32::MAX,
204+
int8: i64::MAX,
205205
timestamp: Value::Timestamp(Timestamp::from_microseconds_since_epoch(1710837304040956).expect("failed to create timestamp")),
206206
bigDecimal: decimal.clone(),
207207
bigDecimalArray: vec![decimal.clone(), (decimal + 1.into())],

store/test-store/tests/postgres/relational_bytes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ lazy_static! {
4343
static ref THINGS_SCHEMA: InputSchema =
4444
InputSchema::parse_latest(THINGS_GQL, THINGS_SUBGRAPH_ID.clone())
4545
.expect("Failed to parse THINGS_GQL");
46-
static ref LARGE_INT: BigInt = BigInt::from(std::i64::MAX).pow(17).unwrap();
46+
static ref LARGE_INT: BigInt = BigInt::from(i64::MAX).pow(17).unwrap();
4747
static ref LARGE_DECIMAL: BigDecimal =
4848
BigDecimal::from(1) / BigDecimal::new(LARGE_INT.clone(), 1);
4949
static ref BYTES_VALUE: H256 = H256::from(hex!(

0 commit comments

Comments
 (0)