Commit 517f38b6 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'clippy-20171108'

603b1b6a clippy: global constants are implicitly 'static
b0dd2860 test: prefer const rather than static globals
99544e42 clippy: use Self where possible
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Brad King's avatarBrad King <brad.king@kitware.com>
Merge-request: !58
parents ce058b5a 603b1b6a
......@@ -60,7 +60,7 @@ impl Identity {
where N: ToString,
E: ToString,
{
Identity {
Self {
name: name.to_string(),
email: email.to_string(),
}
......@@ -107,7 +107,7 @@ impl GitContext {
pub fn new<P>(gitdir: P) -> Self
where P: AsRef<Path>,
{
GitContext {
Self {
gitdir: gitdir.as_ref().to_path_buf(),
config: None,
}
......@@ -118,7 +118,7 @@ impl GitContext {
where P: AsRef<Path>,
C: AsRef<Path>,
{
GitContext {
Self {
gitdir: gitdir.as_ref().to_path_buf(),
config: Some(config.as_ref().to_path_buf()),
}
......
......@@ -273,7 +273,7 @@ impl PreparingGitWorkArea {
let tempdir = TempDir::new_in(context.gitdir(), "git-work-area")
.chain_err(|| "failed to create temporary directory")?;
let workarea = PreparingGitWorkArea {
let workarea = Self {
context: context,
dir: tempdir,
};
......@@ -404,7 +404,7 @@ impl GitWorkArea {
pub fn new(context: GitContext, rev: &CommitId) -> Result<Self> {
let intermediate = PreparingGitWorkArea::new(context, rev)?;
let workarea = GitWorkArea {
let workarea = Self {
submodule_config: intermediate.query_submodules()?,
context: intermediate.context,
dir: intermediate.dir,
......
......@@ -135,20 +135,20 @@ fn git_context_new(workspace_path: &Path) -> GitContext {
ctx
}
static ARBITRARY_COMMIT: &'static str = "9266430a205bc43fcb669a9b4825f2c69d36c3db";
const ARBITRARY_COMMIT: &str = "9266430a205bc43fcb669a9b4825f2c69d36c3db";
// These commits contain a submodule for testing merging and related tasks with them.
static BASE_COMMIT: &'static str = "6787f648d93d32e70aea9e94c85914422940a6c0";
static SUBMODULE_ADD_CUSTOM_NAME: &'static str = "d340326994009b57e70e0fc90730ba668d90dab4";
static SUBMODULE_UPDATE_COMMIT: &'static str = "1d1ac896e2908685d6c20f78821add835cb110e8";
static SUBMODULE_REWIND_COMMIT: &'static str = "6995e3989758531fdbd988ece628e7307ab59266";
static SUBMODULE_BRANCH1_COMMIT: &'static str = "6e8ae702722e39626ac686929234eea0dc3d48de";
static SUBMODULE_BRANCH2_COMMIT: &'static str = "0465e50432fcd101e88dc61ecd81ef89b611a991";
static SUBMODULE_UNMERGED_COMMIT: &'static str = "d8df6fab975c401632aecc366d34f9a91da82500";
static SUBMODULE_NOT_PRESENT_COMMIT: &'static str = "5c3eee710420e98fde8818a688bfbf2bb1a96ff8";
const BASE_COMMIT: &str = "6787f648d93d32e70aea9e94c85914422940a6c0";
const SUBMODULE_ADD_CUSTOM_NAME: &str = "d340326994009b57e70e0fc90730ba668d90dab4";
const SUBMODULE_UPDATE_COMMIT: &str = "1d1ac896e2908685d6c20f78821add835cb110e8";
const SUBMODULE_REWIND_COMMIT: &str = "6995e3989758531fdbd988ece628e7307ab59266";
const SUBMODULE_BRANCH1_COMMIT: &str = "6e8ae702722e39626ac686929234eea0dc3d48de";
const SUBMODULE_BRANCH2_COMMIT: &str = "0465e50432fcd101e88dc61ecd81ef89b611a991";
const SUBMODULE_UNMERGED_COMMIT: &str = "d8df6fab975c401632aecc366d34f9a91da82500";
const SUBMODULE_NOT_PRESENT_COMMIT: &str = "5c3eee710420e98fde8818a688bfbf2bb1a96ff8";
// This commit is the conflict resolution between the branch1 and branch2 updates.
static SUBMODULE_RESOLUTION: &'static str = "892c174777e7b9a80383f8cd60f91af72ace2df2";
const SUBMODULE_RESOLUTION: &str = "892c174777e7b9a80383f8cd60f91af72ace2df2";
#[test]
fn test_gitdir() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment