parent
de455873da
commit
e85ddb0d18
2 changed files with 14 additions and 0 deletions
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
All notable changes to similar are documented here.
|
All notable changes to similar are documented here.
|
||||||
|
|
||||||
|
## 2.3.0
|
||||||
|
|
||||||
|
* Added support for `Change::value_ref` and `Change::value_mut`.
|
||||||
|
|
||||||
## 2.2.1
|
## 2.2.1
|
||||||
|
|
||||||
* Fixed a panic in LCS diffs on matching input. (#43)
|
* Fixed a panic in LCS diffs on matching input. (#43)
|
||||||
|
|
|
||||||
10
src/types.rs
10
src/types.rs
|
|
@ -103,6 +103,16 @@ impl<T: Clone> Change<T> {
|
||||||
pub fn value(&self) -> T {
|
pub fn value(&self) -> T {
|
||||||
self.value.clone()
|
self.value.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the underlying changed value as reference.
|
||||||
|
pub fn value_ref(&self) -> &T {
|
||||||
|
&self.value
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns the underlying changed value as mutable reference.
|
||||||
|
pub fn value_mut(&mut self) -> &mut T {
|
||||||
|
&mut self.value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Utility enum to capture a diff operation.
|
/// Utility enum to capture a diff operation.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue