mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +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::{
|
use std::{
|
||||||
borrow::Cow,
|
borrow::Cow,
|
||||||
fmt::{self, Display},
|
fmt::{self, Display},
|
||||||
ops::Deref,
|
ops::{Deref, DerefMut},
|
||||||
};
|
};
|
||||||
|
|
||||||
pub use crate::{
|
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)]
|
#[derive(Debug, Default, Clone)]
|
||||||
pub struct OxcCode {
|
pub struct OxcCode {
|
||||||
pub scope: Option<Cow<'static, str>>,
|
pub scope: Option<Cow<'static, str>>,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue