summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg <gregory.mkv@gmail.com>2020-03-29 16:37:29 -0400
committerGreg <gregory.mkv@gmail.com>2020-03-29 16:37:29 -0400
commit191af013dc91448a5989fab729359778feb8d2e6 (patch)
treeff6e1c081085f35fa25486715526f66a744f9a4c
parent1532f800c811185e76d1780a96a01ff6d929bf42 (diff)
parent3cd464cce9aa90a198ee1cb6d3ccda135be4e299 (diff)
Merge branch 'master' of github.com:chmln/sd
-rw-r--r--.rustfmt.toml5
-rw-r--r--azure-pipelines.yml71
-rw-r--r--src/input.rs6
3 files changed, 25 insertions, 57 deletions
diff --git a/.rustfmt.toml b/.rustfmt.toml
index a4d7b38..769896d 100644
--- a/.rustfmt.toml
+++ b/.rustfmt.toml
@@ -1,8 +1,3 @@
edition = "2018"
max_width = 80
-wrap_comments = true
-format_strings = true
-merge_imports = true
-match_block_trailing_comma = true
-reorder_impl_items = true
use_field_init_shorthand = true
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 5bc05aa..cd1f22a 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -6,57 +6,30 @@ trigger:
resources:
repositories:
- - repository: templates
+ - repository: rust_pipelines
type: github
name: xoac/rust-azure-pipelines
- ref: refs/tags/v0.0.2
+ ref: refs/heads/master
endpoint: githubConnection
+stages:
+- stage: test
+ displayName: "Test"
+ jobs:
+ - template: ci/jobs/cargo-test.yaml@rust_pipelines
-jobs:
-# This represents the minimum Rust version supported.
-# Tests are not run as tests may require newer versions of rust.
-- template: ci/cargo-check.yml@templates
- parameters:
- name: minrust
- rust_version: 1.31.0 # The 2018 edition
- displayName: Check rust min ver
-
-################
-# Test stage #
-###############
-
-# Test stable
-- template: ci/test.yml@templates
- parameters:
- name: cargo_test_stable
- displayName: Cargo test
- cross: true # Test on Windows and macOS
-
-###################
-# DEPLOY PART #
-###################
-
-# Release binary
-- template: ci/github-release.yml@templates
- parameters:
- name: github_release
- dependsOn:
- - minrust
- - cargo_test_stable
- rust_version: stable
- condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
- contents: |
- *
- !*.rlib
- !*.d
- !.*
- targets:
- - x86_64-unknown-linux-gnu
- - x86_64-unknown-linux-musl
- - x86_64-pc-windows-gnu
- - x86_64-pc-windows-msvc
- - x86_64-apple-darwin
- github:
- gitHubConnection: githubConnection
- repositoryName: chmln/sd
+- stage: build
+ displayName: "Build"
+ condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
+ dependsOn:
+ - test
+# Deploy binaries to github only if tags start with `v` for example `v0.1.5`
+- stage: deploy
+ displayName: "Deploy"
+ dependsOn:
+ - build
+ jobs:
+ - template: ci/scenarios/github/release.yml@rust_pipelines
+ parameters:
+ job_condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
+ gitHubConnection: githubConnection
diff --git a/src/input.rs b/src/input.rs
index 8663b54..28adaf2 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -142,7 +142,7 @@ impl Replacer {
}
Ok(())
- },
+ }
(Source::Files(paths), true) => {
use rayon::prelude::*;
@@ -154,7 +154,7 @@ impl Replacer {
});
Ok(())
- },
+ }
(Source::Files(paths), false) => {
let stdout = std::io::stdout();
let mut handle = stdout.lock();
@@ -166,7 +166,7 @@ impl Replacer {
Ok(())
})
- },
+ }
}
}
}