Skip to content

Commit

Permalink
chore: Update Rust templates
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-psi committed Jul 26, 2023
1 parent 24087aa commit eb715cd
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ edition = "2021"
publish = false

[dependencies]
aidoku = { git = "https://github.com/Aidoku/aidoku-rs/" }
aidoku = { git = "https://github.com/Aidoku/aidoku-rs/", features = ["helpers"] }
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use aidoku::{
error::Result,
prelude::*,
std::{String, Vec, net::Request},
helpers,
Manga, MangaPageResult, Page, Chapter, DeepLink
};

Expand Down
2 changes: 1 addition & 1 deletion internal/templates/resources/rust/Cargo.toml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ strip = true
lto = true
{{ end }}
[dependencies]
aidoku = { git = "https://github.com/Aidoku/aidoku-rs" }{{ if not (eq (len .TemplateName) 0) }}
aidoku = { git = "https://github.com/Aidoku/aidoku-rs", features = ["helpers"] }{{ if not (eq (len .TemplateName) 0) }}
{{ .TemplateName }} = { path = "../../template" }{{ end }}
73 changes: 0 additions & 73 deletions internal/templates/resources/rust/src/helper.rs.tmpl

This file was deleted.

3 changes: 1 addition & 2 deletions internal/templates/resources/rust/src/lib.rs.tmpl
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#![no_std]
{{ if eq (len .TemplateName) 0 }}
mod helper;{{ end }}
use aidoku::{
error::Result,
prelude::*,
std::{String, Vec, net::Request},
helpers,
Chapter, Filter, Listing, Manga, MangaPageResult, Page, DeepLink
};

Expand Down
1 change: 0 additions & 1 deletion internal/templates/rust-template.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func RustTemplateGenerator(output string, source Source) error {
"/.cargo/config": templateFactory(box, "rust/.cargo/config.tmpl"),
"/template/Cargo.toml": templateFactory(box, "rust-template/template/Cargo.toml.tmpl"),
"/template/src/lib.rs": templateFactory(box, "rust-template/template/src/lib.rs.tmpl"),
"/template/src/helper.rs": templateFactory(box, "rust/src/helper.rs.tmpl"),
"/template/src/template.rs": templateFactory(box, "rust-template/template/src/template.rs.tmpl"),
}
// Make the build script executable
Expand Down
1 change: 0 additions & 1 deletion internal/templates/rust.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ func RustGenerator(output string, source Source) error {
files["/.cargo/config"] = templateFactory(box, "rust/.cargo/config.tmpl")
files["/build.sh"] = templateFactory(box, "rust/build.sh.tmpl")
files["/build.ps1"] = templateFactory(box, "rust/build.ps1.tmpl")
files["/src/helper.rs"] = templateFactory(box, "rust/src/helper.rs.tmpl")
}
// Make the build script executable
err = GenerateFilesFromMap(output, source, files)
Expand Down

0 comments on commit eb715cd

Please sign in to comment.