mirror of
https://github.com/astral-sh/ruff
synced 2026-01-23 14:30:53 -05:00
Fix clippy::trivially-copy-pass-by-ref (pedantic) (#862)
This commit is contained in:
@@ -25,7 +25,7 @@ impl<'a> SourceCodeLocator<'a> {
|
||||
self.rope.get_or_init(|| Rope::from_str(self.contents))
|
||||
}
|
||||
|
||||
pub fn slice_source_code_at(&self, location: &Location) -> Cow<'_, str> {
|
||||
pub fn slice_source_code_at(&self, location: Location) -> Cow<'_, str> {
|
||||
let rope = self.get_or_init_rope();
|
||||
let offset = rope.line_to_char(location.row() - 1) + location.column();
|
||||
Cow::from(rope.slice(offset..))
|
||||
|
||||
Reference in New Issue
Block a user