We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2c0e22 commit c67569aCopy full SHA for c67569a
Cargo.toml
@@ -1,6 +1,6 @@
1
[package]
2
name = "jsonc-parser"
3
-version = "0.18.0"
+version = "0.19.0"
4
authors = ["David Sherret <dsherret@gmail.com>"]
5
edition = "2021"
6
license = "MIT"
src/common.rs
@@ -7,6 +7,16 @@ pub struct Range {
7
pub end: usize,
8
}
9
10
+impl Range {
11
+ pub fn new(start: usize, end: usize) -> Self {
12
+ Range { start, end }
13
+ }
14
+
15
+ pub fn from_byte_index(pos: usize) -> Self {
16
+ Range::new(pos, pos)
17
18
+}
19
20
impl Ranged for Range {
21
fn range(&self) -> &Range {
22
self
0 commit comments