mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
feat(oxc_diagnostic): impl DerefMut for OxcDiagnostic (#5474)
1. Impl `DerefMut` for `OxcDiagnositc` so downstream user could move `OxcDiagnostic` rather clone it,
40ae24d597/crates/rolldown_ecmascript/src/ecma_compiler.rs (L36-L48)
This commit is contained in:
parent
9b984b31bd
commit
91b39c4b82
1 changed files with 7 additions and 1 deletions
|
|
@ -9,7 +9,7 @@ mod service;
|
|||
use std::{
|
||||
borrow::Cow,
|
||||
fmt::{self, Display},
|
||||
ops::Deref,
|
||||
ops::{Deref, DerefMut},
|
||||
};
|
||||
|
||||
pub use crate::{
|
||||
|
|
@ -42,6 +42,12 @@ impl Deref for OxcDiagnostic {
|
|||
}
|
||||
}
|
||||
|
||||
impl DerefMut for OxcDiagnostic {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.inner
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Clone)]
|
||||
pub struct OxcCode {
|
||||
pub scope: Option<Cow<'static, str>>,
|
||||
|
|
|
|||
Loading…
Reference in a new issue