Skip to content

Commit 36fb489

Browse files
committed
Add more documentation comments
1 parent bc07891 commit 36fb489

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/cmd_line.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
/// This module defines the command-line arguments and behavior of `newdoc`.
2+
/// It relies on the `clap` crate.
3+
14
use clap::{
25
crate_authors, crate_description, crate_name, crate_version, App, AppSettings, Arg, ArgGroup,
36
ArgMatches,
47
};
58

9+
/// Define the command-line arguments and return them as the `clap::ArgMatches` struct.
610
pub fn get_args() -> ArgMatches<'static> {
711
// Define command-line options
812
App::new(crate_name!())

src/module.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// This module defines the `Module` struct, its builder struct, and methods on both structs.
2+
13
use crate::Options;
24

35
/// All possible types of the AsciiDoc module
@@ -36,6 +38,7 @@ const CONCEPT_TEMPLATE: &str = include_str!("../templates/concept.adoc");
3638
const PROCEDURE_TEMPLATE: &str = include_str!("../templates/procedure.adoc");
3739
const REFERENCE_TEMPLATE: &str = include_str!("../templates/reference.adoc");
3840

41+
/// Construct a basic builder for `Module`, storing information from the user input.
3942
impl Input {
4043
pub fn new(mod_type: ModuleType, title: &str, options: &Options) -> Input {
4144
let title = String::from(title);
@@ -212,6 +215,7 @@ impl Input {
212215
}
213216

214217
impl From<Input> for Module {
218+
/// Convert the `Input` builder struct into the finished `Module` struct.
215219
fn from(input: Input) -> Self {
216220
// TODO: I suspect that these `clone` calls aren't really necessary, but I don't know Rust
217221
// well enough to figure out the proper solution now.
@@ -236,7 +240,8 @@ impl From<Input> for Module {
236240
}
237241

238242
impl Module {
239-
/// The constructor for the Module struct
243+
/// The constructor for the Module struct. Creates a basic version of Module
244+
/// without any optional features.
240245
pub fn new(mod_type: ModuleType, title: &str, options: &Options) -> Module {
241246
let input = Input::new(mod_type, title, options);
242247
input.into()

0 commit comments

Comments
 (0)