Skip to content

Commit 54aaa3e

Browse files
committed
Address some clippy warnings
1 parent 88b1688 commit 54aaa3e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl JsonValue {
191191

192192
/// Pretty prints out the value as JSON string. Takes an argument that's
193193
/// number of spaces to indent new blocks with.
194-
pub fn pretty<'a>(&self, spaces: u16) -> String {
194+
pub fn pretty(&self, spaces: u16) -> String {
195195
let mut gen = Generator::new(false, spaces);
196196
gen.write_json(self);
197197
gen.consume()
@@ -211,7 +211,7 @@ pub fn stringify<T>(root: T) -> String where T: Into<JsonValue> {
211211

212212
/// Pretty prints out the value as JSON string. Second argument is a
213213
/// number of spaces to indent new blocks with.
214-
pub fn stringify_pretty<'a, T>(root: T, spaces: u16) -> String where T: Into<JsonValue> {
214+
pub fn stringify_pretty<T>(root: T, spaces: u16) -> String where T: Into<JsonValue> {
215215
let root: JsonValue = root.into();
216216
root.pretty(spaces)
217217
}

src/parser.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<'a> Tokenizer<'a> {
7777
}
7878
}
7979

80-
return label;
80+
label
8181
}
8282

8383
fn read_codepoint(&mut self) -> JsonResult<char> {
@@ -95,7 +95,7 @@ impl<'a> Tokenizer<'a> {
9595
let mut escape = false;
9696

9797
while let Some(ch) = self.source.next() {
98-
if ch == first && escape == false {
98+
if ch == first && !escape {
9999
return Ok(value);
100100
}
101101

@@ -181,7 +181,7 @@ impl<'a> Iterator for Tokenizer<'a> {
181181
}
182182
});
183183
}
184-
return None;
184+
None
185185
}
186186
}
187187

src/value.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ impl JsonValue {
148148
_ => {
149149
*self = JsonValue::new_object();
150150
self.put(key, JsonValue::Null).unwrap();
151-
return self.get_mut(key).unwrap();
151+
self.get_mut(key).unwrap()
152152
}
153153
}
154154
}
@@ -275,7 +275,7 @@ impl JsonValue {
275275
impl Index<usize> for JsonValue {
276276
type Output = JsonValue;
277277

278-
fn index<'a>(&'a self, index: usize) -> &'a JsonValue {
278+
fn index(&self, index: usize) -> &JsonValue {
279279
self.at(index).unwrap_or(&NULL)
280280
}
281281
}

0 commit comments

Comments
 (0)