Skip to content

Commit 74f7715

Browse files
committed
Derive: Fully qualify async_trait and drop use
1 parent be5e2f5 commit 74f7715

12 files changed

Lines changed: 21 additions & 42 deletions

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ This crate provides a proc macro that generates code for inserting structs into
55
## Example
66

77
```rust
8-
use async_trait::async_trait;
98
use sqlx::Postgres;
109
use sqlx::Sqlite;
1110
use sqlx_insert::SQLInsert;

sqlx_insert/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use async_trait::async_trait;
1818
///
1919
/// Example:
2020
/// ```rust
21-
/// use async_trait::async_trait;
2221
/// use sqlx::Postgres;
2322
/// use sqlx::Sqlite;
2423
/// use sqlx_insert::SQLInsert;
@@ -43,7 +42,6 @@ pub use sqlx_insert_derive::SQLInsert;
4342
///
4443
/// Example:
4544
/// ```rust
46-
/// use async_trait::async_trait;
4745
/// use sqlx::Postgres;
4846
/// use sqlx::Sqlite;
4947
/// use sqlx::PgConnection;

sqlx_insert/tests/tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use async_trait::async_trait;
21
use sqlx::FromRow;
32
use sqlx::Postgres;
43
use sqlx::Row;

sqlx_insert/tests/ui/not_compatible_fields.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use sqlx_insert::SQLInsert;
2-
use async_trait::async_trait;
32
use sqlx::Postgres;
43

54
#[derive(SQLInsert, Clone, Debug)]

sqlx_insert/tests/ui/not_compatible_fields.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0277]: the trait bound `ComplexType: Type<Postgres>` is not satisfied
2-
--> tests/ui/not_compatible_fields.rs:5:10
2+
--> tests/ui/not_compatible_fields.rs:4:10
33
|
4-
5 | #[derive(SQLInsert, Clone, Debug)]
4+
4 | #[derive(SQLInsert, Clone, Debug)]
55
| ^^^^^^^^^ the trait `Type<Postgres>` is not implemented for `ComplexType`
66
|
77
= help: the following other types implement trait `Type<DB>`:

sqlx_insert/tests/ui/unknown_database.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
use sqlx_insert::SQLInsert;
2-
use async_trait::async_trait;
3-
42
pub struct MariaDB;
53

64
#[derive(SQLInsert, Clone, Debug)]

sqlx_insert/tests/ui/unknown_database.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error[E0277]: the trait bound `i32: Type<MariaDB>` is not satisfied
2-
--> tests/ui/unknown_database.rs:6:10
2+
--> tests/ui/unknown_database.rs:4:10
33
|
4-
6 | #[derive(SQLInsert, Clone, Debug)]
4+
4 | #[derive(SQLInsert, Clone, Debug)]
55
| ^^^^^^^^^ the trait `Type<MariaDB>` is not implemented for `i32`
66
|
77
= help: the following other types implement trait `Type<DB>`:
@@ -12,9 +12,9 @@ error[E0277]: the trait bound `i32: Type<MariaDB>` is not satisfied
1212
= note: this error originates in the derive macro `SQLInsert` (in Nightly builds, run with -Z macro-backtrace for more info)
1313

1414
error[E0277]: the trait bound `std::string::String: Type<MariaDB>` is not satisfied
15-
--> tests/ui/unknown_database.rs:6:10
15+
--> tests/ui/unknown_database.rs:4:10
1616
|
17-
6 | #[derive(SQLInsert, Clone, Debug)]
17+
4 | #[derive(SQLInsert, Clone, Debug)]
1818
| ^^^^^^^^^ the trait `Type<MariaDB>` is not implemented for `std::string::String`
1919
|
2020
= help: the following other types implement trait `Type<DB>`:
@@ -25,9 +25,9 @@ error[E0277]: the trait bound `std::string::String: Type<MariaDB>` is not satisf
2525
= note: this error originates in the derive macro `SQLInsert` (in Nightly builds, run with -Z macro-backtrace for more info)
2626

2727
error[E0277]: the trait bound `MariaDB: sqlx::Database` is not satisfied
28-
--> tests/ui/unknown_database.rs:6:10
28+
--> tests/ui/unknown_database.rs:4:10
2929
|
30-
6 | #[derive(SQLInsert, Clone, Debug)]
30+
4 | #[derive(SQLInsert, Clone, Debug)]
3131
| ^^^^^^^^^ the trait `sqlx::Database` is not implemented for `MariaDB`
3232
|
3333
= help: the following other types implement trait `sqlx::Database`:
@@ -42,9 +42,9 @@ note: required by a bound in `SQLInsert`
4242
= note: this error originates in the derive macro `SQLInsert` (in Nightly builds, run with -Z macro-backtrace for more info)
4343

4444
error[E0277]: the trait bound `MariaDB: sqlx::Database` is not satisfied
45-
--> tests/ui/unknown_database.rs:6:10
45+
--> tests/ui/unknown_database.rs:4:10
4646
|
47-
6 | #[derive(SQLInsert, Clone, Debug)]
47+
4 | #[derive(SQLInsert, Clone, Debug)]
4848
| ^^^^^^^^^ the trait `sqlx::Database` is not implemented for `MariaDB`
4949
|
5050
= help: the following other types implement trait `sqlx::Database`:

sqlx_insert/tests/ui/unnamed_fields.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use sqlx_insert::SQLInsert;
2-
use async_trait::async_trait;
32
use sqlx::Postgres;
43

54
#[derive(SQLInsert, Clone, Debug)]
Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
error: proc-macro derive panicked
2-
--> tests/ui/unnamed_fields.rs:5:10
2+
--> tests/ui/unnamed_fields.rs:4:10
33
|
4-
5 | #[derive(SQLInsert, Clone, Debug)]
4+
4 | #[derive(SQLInsert, Clone, Debug)]
55
| ^^^^^^^^^
66
|
77
= help: message: failed to expand SQLInsert macro: Error("only named struct fields are supported")
88

9-
warning: unused import: `async_trait::async_trait`
9+
warning: unused import: `sqlx::Postgres`
1010
--> tests/ui/unnamed_fields.rs:2:5
1111
|
12-
2 | use async_trait::async_trait;
13-
| ^^^^^^^^^^^^^^^^^^^^^^^^
12+
2 | use sqlx::Postgres;
13+
| ^^^^^^^^^^^^^^
1414
|
1515
= note: `#[warn(unused_imports)]` on by default
16-
17-
warning: unused import: `sqlx::Postgres`
18-
--> tests/ui/unnamed_fields.rs:3:5
19-
|
20-
3 | use sqlx::Postgres;
21-
| ^^^^^^^^^^^^^^

sqlx_insert/tests/ui/unsupported_types.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use sqlx_insert::SQLInsert;
2-
use async_trait::async_trait;
32
use sqlx::Postgres;
43

54
#[derive(SQLInsert, Clone, Debug)]

0 commit comments

Comments
 (0)