flip Into to From

This commit is contained in:
Aleksey Kladov 2019-05-29 10:13:27 +03:00
parent 2e722ec54b
commit 38cb88307e

View file

@ -19,15 +19,15 @@ pub enum Location {
Range(TextRange),
}
impl Into<Location> for TextUnit {
fn into(self) -> Location {
Location::Offset(self)
impl From<TextUnit> for Location {
fn from(offset: TextUnit) -> Location {
Location::Offset(offset)
}
}
impl Into<Location> for TextRange {
fn into(self) -> Location {
Location::Range(self)
impl From<TextRange> for Location {
fn from(range: TextRange) -> Location {
Location::Range(range)
}
}