clippy_dev: Use the new ranges.
This commit is contained in:
parent
88c0674bc8
commit
5e36990de0
5 changed files with 8 additions and 6 deletions
|
|
@ -132,14 +132,14 @@ fn remove_lint_declaration(name: &str, path: &Path, lints: &mut Vec<Lint>) -> io
|
|||
);
|
||||
|
||||
assert!(
|
||||
content[lint.declaration_range.clone()].contains(&name.to_uppercase()),
|
||||
content[lint.declaration_range].contains(&name.to_uppercase()),
|
||||
"error: `{}` does not contain lint `{}`'s declaration",
|
||||
path.display(),
|
||||
lint.name
|
||||
);
|
||||
|
||||
// Remove lint declaration (declare_clippy_lint!)
|
||||
content.replace_range(lint.declaration_range.clone(), "");
|
||||
content.replace_range(lint.declaration_range, "");
|
||||
|
||||
// Remove the module declaration (mod xyz;)
|
||||
let mod_decl = format!("\nmod {name};");
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
#![feature(
|
||||
rustc_private,
|
||||
exit_status_error,
|
||||
if_let_guard,
|
||||
new_range,
|
||||
new_range_api,
|
||||
os_str_slice,
|
||||
os_string_truncate,
|
||||
rustc_private,
|
||||
slice_split_once
|
||||
)]
|
||||
#![warn(
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ pub mod cursor;
|
|||
|
||||
use self::cursor::Cursor;
|
||||
use crate::utils::{ErrAction, File, expect_action};
|
||||
use core::ops::Range;
|
||||
use core::range::Range;
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
use walkdir::{DirEntry, WalkDir};
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ pub fn bump_version(mut version: Version) {
|
|||
dst.push_str(&src[..package.version_range.start]);
|
||||
write!(dst, "\"{}\"", version.toml_display()).unwrap();
|
||||
dst.push_str(&src[package.version_range.end..]);
|
||||
UpdateStatus::from_changed(src.get(package.version_range.clone()) != dst.get(package.version_range))
|
||||
UpdateStatus::from_changed(src.get(package.version_range) != dst.get(package.version_range))
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use core::fmt::{self, Display};
|
||||
use core::num::NonZero;
|
||||
use core::ops::Range;
|
||||
use core::range::Range;
|
||||
use core::str::FromStr;
|
||||
use std::ffi::OsStr;
|
||||
use std::fs::{self, OpenOptions};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue