mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:44:56 +00:00
Bump MSRV to Rust 1.80 (#13826)
This commit is contained in:
parent
075e378b0f
commit
27c50bebec
42 changed files with 110 additions and 133 deletions
|
@ -1,6 +1,6 @@
|
|||
use std::cmp::Ordering;
|
||||
use std::fmt::{Debug, Display, Formatter};
|
||||
use std::sync::Arc;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -134,9 +134,9 @@ impl SourceFileBuilder {
|
|||
/// Consumes `self` and returns the [`SourceFile`].
|
||||
pub fn finish(self) -> SourceFile {
|
||||
let index = if let Some(index) = self.index {
|
||||
once_cell::sync::OnceCell::with_value(index)
|
||||
OnceLock::from(index)
|
||||
} else {
|
||||
once_cell::sync::OnceCell::new()
|
||||
OnceLock::new()
|
||||
};
|
||||
|
||||
SourceFile {
|
||||
|
@ -218,7 +218,7 @@ impl Ord for SourceFile {
|
|||
struct SourceFileInner {
|
||||
name: Box<str>,
|
||||
code: Box<str>,
|
||||
line_index: once_cell::sync::OnceCell<LineIndex>,
|
||||
line_index: OnceLock<LineIndex>,
|
||||
}
|
||||
|
||||
impl PartialEq for SourceFileInner {
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
//! Struct used to efficiently slice source code at (row, column) Locations.
|
||||
|
||||
use std::ops::Add;
|
||||
|
||||
use memchr::{memchr2, memrchr2};
|
||||
use once_cell::unsync::OnceCell;
|
||||
use ruff_text_size::{Ranged, TextLen, TextRange, TextSize};
|
||||
use std::cell::OnceCell;
|
||||
use std::ops::Add;
|
||||
|
||||
use crate::newlines::find_newline;
|
||||
use crate::{LineIndex, OneIndexed, SourceCode, SourceLocation};
|
||||
|
@ -23,10 +22,10 @@ impl<'a> Locator<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
pub const fn with_index(contents: &'a str, index: LineIndex) -> Self {
|
||||
pub fn with_index(contents: &'a str, index: LineIndex) -> Self {
|
||||
Self {
|
||||
contents,
|
||||
index: OnceCell::with_value(index),
|
||||
index: OnceCell::from(index),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue