clippy+fmt

This commit is contained in:
Anton-4 2022-11-15 17:38:24 +01:00
parent e9d8d13b02
commit b681949461
No known key found for this signature in database
GPG key ID: A13F4A6E21141925
5 changed files with 14 additions and 11 deletions

View file

@ -118,7 +118,12 @@ mod cli_run {
panic!("\n___________\nThe roc command:\n\n {}\n\nhad unexpected stderr:\n\n {}\n___________\n", compile_out.cmd_str, stderr);
}
assert!(compile_out.status.success(), "\n___________\nRoc command failed with status {:?}:\n\n {:?}\n___________\n", compile_out.status, compile_out);
assert!(
compile_out.status.success(),
"\n___________\nRoc command failed with status {:?}:\n\n {:?}\n___________\n",
compile_out.status,
compile_out
);
compile_out
}

View file

@ -222,14 +222,14 @@ fn run_command(mut command: Command, flaky_fail_counter: usize) {
} else {
run_command(command, flaky_fail_counter + 1)
}
} else {
if error_str.contains("lld-link: error: failed to write the output file: Permission denied") {
panic!("{} failed with:\n\n {}\n\nWorkaround:\n\n Re-run the cargo command that triggered this build.", command_str, error_str);
} else if error_str
.contains("lld-link: error: failed to write the output file: Permission denied")
{
panic!("{} failed with:\n\n {}\n\nWorkaround:\n\n Re-run the cargo command that triggered this build.\n\n", command_str, error_str);
} else {
panic!("{} failed with:\n\n {}\n", command_str, error_str);
}
}
}
},
Err(reason) => panic!("{} failed: {}", command_str, reason),
}

View file

@ -18,7 +18,6 @@ const NEWLINE: &str = "\r\n";
#[cfg(not(windows))]
const NEWLINE: &str = "\n";
#[derive(Debug)]
pub struct Ast<'a> {
pub module: Module<'a>,

View file

@ -4,6 +4,7 @@ use std::path::{Path, PathBuf};
use bumpalo::Bump;
use roc_module::symbol::ModuleId;
#[cfg(not(windows))]
const ROC_SKIP_SUBS_CACHE: &str = "ROC_SKIP_SUBS_CACHE";
const SKIP_SUBS_CACHE: bool = {

View file

@ -3,7 +3,7 @@ use snafu::OptionExt;
use std::{
collections::HashMap,
env::{self, VarError},
path::PathBuf,
path::{Path, PathBuf},
process::Command,
slice::SliceIndex,
};
@ -107,7 +107,6 @@ pub fn get_lib_path() -> Option<PathBuf> {
let exe_relative_str_path_opt = std::env::current_exe().ok();
if let Some(exe_relative_str_path) = exe_relative_str_path_opt {
#[cfg(windows)]
let exe_relative_str_path = strip_windows_prefix(&exe_relative_str_path);
@ -136,8 +135,7 @@ pub fn get_lib_path() -> Option<PathBuf> {
/// Such a path does not works as an argument to `zig` and other command line tools,
/// and there seems to be no good way to strip it. So we resort to some string manipulation.
#[cfg(windows)]
pub fn strip_windows_prefix(path_buf: &PathBuf) -> std::path::PathBuf {
pub fn strip_windows_prefix(path_buf: &Path) -> std::path::PathBuf {
let path_str = path_buf.display().to_string();
std::path::Path::new(path_str.trim_start_matches(r"\\?\")).to_path_buf()