Skip to content

Commit bed1c68

Browse files
committed
fixed some more doc tests
listened to clippy
1 parent 9455545 commit bed1c68

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

git-function-history-lib/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub enum Filter {
124124
/// # examples
125125
///
126126
/// ```
127-
/// use git_function_history::{get_function_history, Filter, FileFilterType, Language};
127+
/// use git_function_history::{get_function_history, Filter, FileFilterType};
128128
/// let t = get_function_history("empty_test", &FileFilterType::Absolute("src/test_functions.rs".to_string()), &Filter::None, function_grep::supported_languages::predefined_languages()).unwrap();
129129
/// ```
130130
///
@@ -445,7 +445,7 @@ impl Default for MacroOpts<'_, '_> {
445445
///
446446
/// # examples
447447
/// ```rust
448-
/// use git_function_history::{get_function_history, languages::Language, Filter, FileFilterType};
448+
/// use git_function_history::{get_function_history, Filter, FileFilterType};
449449
/// git_function_history::get_function_history!(name = "main", file = FileFilterType::Relative("src/main.rs".to_string()), filter = Filter::None,default_languages = false, supported_languages = vec![&function_grep::supported_languages::Rust]);
450450
/// ```
451451
///

git-function-history-lib/src/types.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ impl Commit {
6464
}
6565

6666
/// sets the current file to the next file if possible
67-
pub fn move_forward(&mut self) {
67+
pub const fn move_forward(&mut self) {
6868
if self.current_pos >= self.files.len() - 1 {
6969
return;
7070
}
7171
self.current_pos += 1;
7272
}
7373

7474
/// sets the current file to the previous file if possible
75-
pub fn move_back(&mut self) {
75+
pub const fn move_back(&mut self) {
7676
if self.current_pos == 0 {
7777
return;
7878
}
@@ -103,7 +103,7 @@ impl Commit {
103103
}
104104

105105
/// tells you in which directions you can move through the files in the commit
106-
pub fn get_move_direction(&self) -> Directions {
106+
pub const fn get_move_direction(&self) -> Directions {
107107
match self.current_pos {
108108
0 if self.files.len() == 1 => Directions::None,
109109
0 => Directions::Forward,
@@ -294,7 +294,7 @@ impl FunctionHistory {
294294
}
295295

296296
/// returns the directions in which ways you can move through the commit history
297-
pub fn get_move_direction(&self) -> Directions {
297+
pub const fn get_move_direction(&self) -> Directions {
298298
match self.current_pos {
299299
0 if self.commit_history.len() == 1 => Directions::None,
300300
0 => Directions::Forward,
@@ -314,9 +314,9 @@ impl FunctionHistory {
314314
///
315315
/// # examples
316316
/// ```rust
317-
/// use git_function_history::{get_function_history, Filter, FileFilterType, Language};
317+
/// use git_function_history::{get_function_history, Filter, FileFilterType};
318318
///
319-
/// let history = get_function_history("new", &FileFilterType::None, &Filter::None, &Language::Rust).unwrap();
319+
/// let history = get_function_history("new", &FileFilterType::None, &Filter::None, function_grep::supported_languages::predefined_languages()).unwrap();
320320
///
321321
/// history.filter_by(&Filter::Directory("app".to_string())).unwrap();
322322
/// ```

0 commit comments

Comments
 (0)