Skip to content

Commit bc07891

Browse files
committed
Apply cargo fmt suggestions
1 parent 415534d commit bc07891

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ fn main() {
6666
assert!(!include_statements.is_empty());
6767

6868
// Generate the populated assembly module
69-
let populated: Module =
70-
Input::new(ModuleType::Assembly, title, &options).include(include_statements).into();
69+
let populated: Module = Input::new(ModuleType::Assembly, title, &options)
70+
.include(include_statements)
71+
.into();
7172

7273
populated.write_file(&options);
7374
}

src/module.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const CONCEPT_TEMPLATE: &str = include_str!("../templates/concept.adoc");
3636
const PROCEDURE_TEMPLATE: &str = include_str!("../templates/procedure.adoc");
3737
const REFERENCE_TEMPLATE: &str = include_str!("../templates/reference.adoc");
3838

39-
4039
impl Input {
4140
pub fn new(mod_type: ModuleType, title: &str, options: &Options) -> Input {
4241
let title = String::from(title);
@@ -168,7 +167,10 @@ impl Input {
168167
};
169168

170169
// Define the strings that will be replaced in the template
171-
let replacements = [("${module_title}", &self.title), ("${module_id}", &self.id())];
170+
let replacements = [
171+
("${module_title}", &self.title),
172+
("${module_id}", &self.id()),
173+
];
172174

173175
// Perform substitutions in the template
174176
// TODO: Create a separate function to perform a replacement
@@ -209,7 +211,6 @@ impl Input {
209211
}
210212
}
211213

212-
213214
impl From<Input> for Module {
214215
fn from(input: Input) -> Self {
215216
// TODO: I suspect that these `clone` calls aren't really necessary, but I don't know Rust
@@ -234,7 +235,6 @@ impl From<Input> for Module {
234235
}
235236
}
236237

237-
238238
impl Module {
239239
/// The constructor for the Module struct
240240
pub fn new(mod_type: ModuleType, title: &str, options: &Options) -> Module {

src/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use std::path::PathBuf;
44

55
use colored::*;
66

7-
use crate::Options;
87
use crate::module::Module;
8+
use crate::Options;
99

1010
impl Module {
1111
/// Write the generated module content to the path specified in `options` with the set file name.

0 commit comments

Comments
 (0)