History

thanks clippy

Sebastian Thiel committed 4 years ago

Commit 8e2e4e31 parent 76e91103 files · +4 −6Browse files

Unified · Split

3 files
  1. git-repository/src/repository/config.rs +2 −0
  2. git-repository/tests/easy/ext/object.rs +1 −1
  3. git-repository/tests/repo.rs +1 −5
git-repository/src/repository/config.rs+2−0
@@ -3,6 +3,8 @@ impl crate::Repository { · 2 unmodified lines
33 /// Return the integer value at `key` (like `core.abbrev`) or use the given `default` value if it isn't present.
44 // TODO: figure out how to identify sub-sections, or how to design such an API. This is really just a first test.
55 // TODO: tests
6+ // TODO: parse-errors do exist, don't dumb it down too much as to not fill in defaults for incorrect configuration.
7+ // Fail like git does.
68 pub(crate) fn config_int(&self, key: &str, default: i64) -> i64 {
79 let (section, key) = key.split_once('.').expect("valid section.key format");
810 self.config
git-repository/tests/easy/ext/object.rs+1−1
@@ -44,7 +44,7 @@ mod find { · 43 unmodified lines
4444 mod tag {
4545 #[test]
4646 fn simple() -> crate::Result {
47− let (repo, _keep) = crate::easy_repo_rw("make_basic_repo.sh")?;
47+ let (repo, _keep) = crate::repo_rw("make_basic_repo.sh")?;
4848 let current_head_id = repo.head()?.peeled()?.id().expect("born");
4949 let message = "a multi\nline message";
5050 let tag_ref = repo.tag(
git-repository/tests/repo.rs+1−5
@@ -16,16 +16,12 @@ fn repo_rw(name: &str) -> crate::Result<(git_repository::Repository, tempfile::T · 15 unmodified lines
1616 ))
1717 }
1818
19−fn easy_repo_rw(name: &str) -> crate::Result<(Repository, tempfile::TempDir)> {
20− repo_rw(name).map(|(repo, dir)| (repo.into(), dir))
21−}
22−
2319 fn basic_repo() -> crate::Result<Repository> {
2420 repo("make_basic_repo.sh").map(|r| r.to_thread_local())
2521 }
2622
2723 fn basic_rw_repo() -> crate::Result<(Repository, tempfile::TempDir)> {
28− easy_repo_rw("make_basic_repo.sh")
24+ repo_rw("make_basic_repo.sh")
2925 }
3026
3127 mod discover;