Skip to content

Commit

Permalink
Merge pull request #66 from epage/template
Browse files Browse the repository at this point in the history
chore: Update from '_rust/main' template
  • Loading branch information
epage committed May 19, 2023
2 parents 8b583a0 + d345ce3 commit 16872d3
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 11 deletions.
11 changes: 6 additions & 5 deletions .clippy.toml
Expand Up @@ -3,10 +3,11 @@ warn-on-all-wildcard-imports = true
allow-expect-in-tests = true
allow-unwrap-in-tests = true
allow-dbg-in-tests = true
allow-print-in-tests = true
disallowed-methods = [
{ path = "std::option::Option::map_or", reason = "use `map(..).unwrap_or(..)`" },
{ path = "std::option::Option::map_or_else", reason = "use `map(..).unwrap_or_else(..)`" },
{ path = "std::result::Result::map_or", reason = "use `map(..).unwrap_or(..)`" },
{ path = "std::result::Result::map_or_else", reason = "use `map(..).unwrap_or_else(..)`" },
{ path = "std::option::Option::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" },
{ path = "std::option::Option::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" },
{ path = "std::result::Result::map_or", reason = "prefer `map(..).unwrap_or(..)` for legibility" },
{ path = "std::result::Result::map_or_else", reason = "prefer `map(..).unwrap_or_else(..)` for legibility" },
{ path = "std::iter::Iterator::for_each", reason = "prefer `for` for side-effects" },
{ path = "std::iter::Iterator::try_for_each", reason = "prefer `for` for side-effects" },
]
7 changes: 5 additions & 2 deletions .github/settings.yml
Expand Up @@ -10,9 +10,12 @@ repository:
has_downloads: true
default_branch: master

allow_squash_merge: true
# Preference: people do clean commits
allow_merge_commit: true
allow_rebase_merge: true
# Backup in case we need to clean up commits
allow_squash_merge: true
# Not really needed
allow_rebase_merge: false

allow_auto_merge: true
delete_branch_on_merge: true
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -126,3 +126,5 @@ jobs:
with:
sarif_file: clippy-results.sarif
wait-for-processing: true
- name: Report status
run: cargo clippy --workspace --all-features --all-targets -- -D warnings --allow deprecated
3 changes: 2 additions & 1 deletion examples/example_fixture.rs
Expand Up @@ -15,7 +15,8 @@ fn run() -> Result<(), Box<dyn Error>> {
let code = env::var("exit")
.ok()
.map(|v| v.parse::<i32>())
.map_or(Ok(None), |r| r.map(Some))?
.map(|r| r.map(Some))
.unwrap_or(Ok(None))?
.unwrap_or(0);
process::exit(code);
}
Expand Down
3 changes: 2 additions & 1 deletion src/bin/bin_fixture.rs
Expand Up @@ -15,7 +15,8 @@ fn run() -> Result<(), Box<dyn Error>> {
let code = env::var("exit")
.ok()
.map(|v| v.parse::<i32>())
.map_or(Ok(None), |r| r.map(Some))?
.map(|r| r.map(Some))
.unwrap_or(Ok(None))?
.unwrap_or(0);
process::exit(code);
}
Expand Down
1 change: 1 addition & 0 deletions src/format/mod.rs
Expand Up @@ -14,6 +14,7 @@ type CowStr<'a> = borrow::Cow<'a, str>;
/// A cargo message
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(tag = "reason", rename_all = "kebab-case")]
#[allow(clippy::large_enum_variant)]
pub enum Message<'a> {
/// Build completed, all further output should not be parsed
BuildFinished(BuildFinished),
Expand Down
2 changes: 1 addition & 1 deletion tests/build.rs
Expand Up @@ -2,7 +2,7 @@ fn test_fixture(name: &str) {
let temp = assert_fs::TempDir::new().unwrap();

let msgs = escargot::CargoBuild::new()
.manifest_path(&format!("tests/fixtures/{}/Cargo.toml", name))
.manifest_path(format!("tests/fixtures/{}/Cargo.toml", name))
.current_release()
.current_target()
.target_dir(temp.path())
Expand Down
2 changes: 1 addition & 1 deletion tests/run.rs
Expand Up @@ -2,7 +2,7 @@ fn test_fixture(name: &str) {
let temp = assert_fs::TempDir::new().unwrap();

let cmd = escargot::CargoBuild::new()
.manifest_path(&format!("tests/fixtures/{}/Cargo.toml", name))
.manifest_path(format!("tests/fixtures/{}/Cargo.toml", name))
.current_release()
.current_target()
.target_dir(temp.path())
Expand Down

0 comments on commit 16872d3

Please sign in to comment.