Skip to content

Commit c67569a

Browse files
committedJan 29, 2022
chore(release): 0.19.0
1 parent e2c0e22 commit c67569a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
 

‎Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "jsonc-parser"
3-
version = "0.18.0"
3+
version = "0.19.0"
44
authors = ["David Sherret <dsherret@gmail.com>"]
55
edition = "2021"
66
license = "MIT"

‎src/common.rs

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ pub struct Range {
77
pub end: usize,
88
}
99

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+
1020
impl Ranged for Range {
1121
fn range(&self) -> &Range {
1222
self

0 commit comments

Comments
 (0)