Skip to content

Commit

Permalink
feat(code): use "use diesel" instead of "use crate::diesel"
Browse files Browse the repository at this point in the history
fixes #94
  • Loading branch information
hasezoey committed Nov 2, 2023
1 parent 6d6a4e2 commit 5062ebe
Show file tree
Hide file tree
Showing 34 changed files with 34 additions and 33 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- add many doc-comments to fields and functions
- list changes to files (unchanged, modified, deleted)
- generate doc-comments for generated structs, fields and functions
- change the diesel import to be `use diesel` (instead of the previous `use crate::diesel`)

## 0.0.17 (yanked)

Expand Down
2 changes: 1 addition & 1 deletion src/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ fn build_imports(table: &ParsedTableMacro, config: &GenerationConfig) -> String
// Note: i guess this could also just be a string that is appended to, or a vec of "Cow", but i personally think this is the most use-able
// because you dont have to think of any context style (like forgetting to put "\n" before / after something)
let mut imports_vec = Vec::with_capacity(10);
imports_vec.push("use crate::diesel::*;".into());
imports_vec.push("use diesel::*;".into());

let table_options = config.table(&table.name.to_string());
imports_vec.extend(table.foreign_keys.iter().map(|fk| {
Expand Down
2 changes: 1 addition & 1 deletion test/autogenerated_all/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/autogenerated_attributes/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/autogenerated_primary_keys/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/cleanup_generated_content/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/create_update_str_cow/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/create_update_str_str/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::data::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::data::models::table_a::TableA;
use crate::data::schema::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion test/custom_model_path/models/tableA/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/custom_model_path/models/tableB/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::data::models::table_a::TableA;
use crate::schema::*;
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 1 addition & 1 deletion test/manual_primary_keys/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/multiple_primary_keys/models/users/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/once_common_structs/models/table1/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/once_common_structs/models/table2/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/once_connection_type/models/table1/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/once_connection_type/models/table2/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/readonly/models/normal/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/readonly/models/prefixTable/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/readonly/models/prefixTableSuffix/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/readonly/models/tableSuffix/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/simple_table/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/simple_table_async/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use diesel_async::RunQueryDsl;
use crate::schema::*;
use serde::{Deserialize, Serialize};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::data::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/simple_table_no_crud/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion test/simple_table_no_serde/models/todos/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use diesel::QueryResult;

Expand Down
2 changes: 1 addition & 1 deletion test/single_model_file/models/table1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/single_model_file/models/table2.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down
2 changes: 1 addition & 1 deletion test/use_statements/models/fang_tasks/generated.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @generated and managed by dsync */

use crate::diesel::*;
use diesel::*;
use crate::schema::*;
use serde::{Deserialize, Serialize};
use diesel::QueryResult;
Expand Down

0 comments on commit 5062ebe

Please sign in to comment.