mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Cargo Format
Run `cargo fmt` and ignore generated files
This commit is contained in:
parent
39cb6c6d3f
commit
61f3a438d3
76 changed files with 1936 additions and 1530 deletions
|
@ -1,17 +1,17 @@
|
|||
extern crate itertools;
|
||||
#[macro_use]
|
||||
extern crate failure;
|
||||
extern crate heck;
|
||||
extern crate ron;
|
||||
extern crate tera;
|
||||
extern crate heck;
|
||||
|
||||
use heck::{CamelCase, ShoutySnakeCase, SnakeCase};
|
||||
use itertools::Itertools;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
fs,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use heck::{CamelCase, ShoutySnakeCase, SnakeCase};
|
||||
|
||||
pub type Result<T> = ::std::result::Result<T, failure::Error>;
|
||||
|
||||
|
@ -61,7 +61,6 @@ pub fn collect_tests(s: &str) -> Vec<(usize, Test)> {
|
|||
res
|
||||
}
|
||||
|
||||
|
||||
pub fn update(path: &Path, contents: &str, verify: bool) -> Result<()> {
|
||||
match fs::read_to_string(path) {
|
||||
Ok(ref old_contents) if old_contents == contents => {
|
||||
|
@ -116,5 +115,8 @@ pub fn render_template(template: &Path) -> Result<String> {
|
|||
}
|
||||
|
||||
pub fn project_root() -> PathBuf {
|
||||
Path::new(&std::env::var("CARGO_MANIFEST_DIR").unwrap()).parent().unwrap().to_path_buf()
|
||||
Path::new(&std::env::var("CARGO_MANIFEST_DIR").unwrap())
|
||||
.parent()
|
||||
.unwrap()
|
||||
.to_path_buf()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue