mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:35:58 +00:00
Upgrade to Rust 1.78 (#11260)
This commit is contained in:
parent
349a4cf8ce
commit
6a1e555537
69 changed files with 67 additions and 549 deletions
|
@ -246,7 +246,7 @@ impl<K: std::hash::Hash + Eq, V> MultiMap<K, V> {
|
|||
/// Returns `true` if `key` has any *leading*, *dangling*, or *trailing* parts.
|
||||
#[allow(unused)]
|
||||
pub(super) fn has(&self, key: &K) -> bool {
|
||||
self.index.get(key).is_some()
|
||||
self.index.contains_key(key)
|
||||
}
|
||||
|
||||
/// Returns the *leading*, *dangling*, and *trailing* parts of `key`.
|
||||
|
@ -382,16 +382,16 @@ where
|
|||
|
||||
#[derive(Clone, Debug)]
|
||||
struct InOrderEntry {
|
||||
/// Index into the [MultiMap::parts] vector where the leading parts of this entry start
|
||||
/// Index into the [`MultiMap::parts`] vector where the leading parts of this entry start
|
||||
leading_start: PartIndex,
|
||||
|
||||
/// Index into the [MultiMap::parts] vector where the dangling parts (and, thus, the leading parts end) start.
|
||||
/// Index into the [`MultiMap::parts`] vector where the dangling parts (and, thus, the leading parts end) start.
|
||||
dangling_start: PartIndex,
|
||||
|
||||
/// Index into the [MultiMap::parts] vector where the trailing parts (and, thus, the dangling parts end) of this entry start
|
||||
/// Index into the [`MultiMap::parts`] vector where the trailing parts (and, thus, the dangling parts end) of this entry start
|
||||
trailing_start: Option<PartIndex>,
|
||||
|
||||
/// Index into the [MultiMap::parts] vector where the trailing parts of this entry end
|
||||
/// Index into the [`MultiMap::parts`] vector where the trailing parts of this entry end
|
||||
trailing_end: Option<PartIndex>,
|
||||
|
||||
_count: Count<InOrderEntry>,
|
||||
|
@ -505,7 +505,7 @@ impl InOrderEntry {
|
|||
|
||||
#[derive(Clone, Debug)]
|
||||
struct OutOfOrderEntry {
|
||||
/// Index into the [MultiMap::out_of_order] vector at which offset the leaading vec is stored.
|
||||
/// Index into the [`MultiMap::out_of_order`] vector at which offset the leaading vec is stored.
|
||||
leading_index: usize,
|
||||
_count: Count<OutOfOrderEntry>,
|
||||
}
|
||||
|
|
|
@ -195,9 +195,9 @@ type CommentsMap<'a> = MultiMap<NodeRefEqualityKey<'a>, SourceComment>;
|
|||
/// Cloning `comments` is cheap as it only involves bumping a reference counter.
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) struct Comments<'a> {
|
||||
/// The implementation uses an [Rc] so that [Comments] has a lifetime independent from the [crate::Formatter].
|
||||
/// Independent lifetimes are necessary to support the use case where a (formattable object)[crate::Format]
|
||||
/// iterates over all comments, and writes them into the [crate::Formatter] (mutably borrowing the [crate::Formatter] and in turn its context).
|
||||
/// The implementation uses an [Rc] so that [Comments] has a lifetime independent from the [`crate::Formatter`].
|
||||
/// Independent lifetimes are necessary to support the use case where a (formattable object)[`crate::Format`]
|
||||
/// iterates over all comments, and writes them into the [`crate::Formatter`] (mutably borrowing the [`crate::Formatter`] and in turn its context).
|
||||
///
|
||||
/// ```block
|
||||
/// for leading in f.context().comments().leading_comments(node) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue