diff options
author | Christopher Durham <[email protected]> | 2018-01-27 23:31:23 +0000 |
---|---|---|
committer | Christopher Durham <[email protected]> | 2018-01-27 23:31:23 +0000 |
commit | 4de3c97b2afea55834cd16368f950133459d8c73 (patch) | |
tree | 9091b5dc1b116e5cbb47a535ffa922e66776c800 /src/text.rs | |
parent | 357cd3358167daa38f3ff34d225e1501faff6015 (diff) |
Enforce rustfmt format
Diffstat (limited to 'src/text.rs')
-rw-r--r-- | src/text.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/text.rs b/src/text.rs index af0a4a9e7..ac1a54a75 100644 --- a/src/text.rs +++ b/src/text.rs | |||
@@ -64,7 +64,6 @@ impl ops::SubAssign<TextUnit> for TextUnit { | |||
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | |||
68 | #[derive(Clone, Copy, PartialEq, Eq)] | 67 | #[derive(Clone, Copy, PartialEq, Eq)] |
69 | pub struct TextRange { | 68 | pub struct TextRange { |
70 | start: TextUnit, | 69 | start: TextUnit, |
@@ -83,7 +82,6 @@ impl fmt::Display for TextRange { | |||
83 | } | 82 | } |
84 | } | 83 | } |
85 | 84 | ||
86 | |||
87 | impl TextRange { | 85 | impl TextRange { |
88 | pub fn empty() -> TextRange { | 86 | pub fn empty() -> TextRange { |
89 | TextRange::from_to(TextUnit::new(0), TextUnit::new(0)) | 87 | TextRange::from_to(TextUnit::new(0), TextUnit::new(0)) |
@@ -91,7 +89,10 @@ impl TextRange { | |||
91 | 89 | ||
92 | pub fn from_to(from: TextUnit, to: TextUnit) -> TextRange { | 90 | pub fn from_to(from: TextUnit, to: TextUnit) -> TextRange { |
93 | assert!(from <= to, "Invalid text range [{}; {})", from, to); | 91 | assert!(from <= to, "Invalid text range [{}; {})", from, to); |
94 | TextRange { start: from, end: to } | 92 | TextRange { |
93 | start: from, | ||
94 | end: to, | ||
95 | } | ||
95 | } | 96 | } |
96 | 97 | ||
97 | pub fn from_len(from: TextUnit, len: TextUnit) -> TextRange { | 98 | pub fn from_len(from: TextUnit, len: TextUnit) -> TextRange { |
@@ -121,4 +122,4 @@ impl ops::Index<TextRange> for str { | |||
121 | fn index(&self, index: TextRange) -> &str { | 122 | fn index(&self, index: TextRange) -> &str { |
122 | &self[index.start().0 as usize..index.end().0 as usize] | 123 | &self[index.start().0 as usize..index.end().0 as usize] |
123 | } | 124 | } |
124 | } \ No newline at end of file | 125 | } |