Skip to content

Commit 45730bc

Browse files
committed
Adjust Literal constructor argument names to match those in libproc_macro
1 parent 26d1d3f commit 45730bc

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/fallback.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,10 +1007,10 @@ impl Literal {
10071007
Literal::_new(s)
10081008
}
10091009

1010-
pub fn string(t: &str) -> Literal {
1011-
let mut repr = String::with_capacity(t.len() + 2);
1010+
pub fn string(string: &str) -> Literal {
1011+
let mut repr = String::with_capacity(string.len() + 2);
10121012
repr.push('"');
1013-
let mut chars = t.chars();
1013+
let mut chars = string.chars();
10141014
while let Some(ch) = chars.next() {
10151015
if ch == '\0' {
10161016
repr.push_str(
@@ -1035,14 +1035,14 @@ impl Literal {
10351035
Literal::_new(repr)
10361036
}
10371037

1038-
pub fn character(t: char) -> Literal {
1038+
pub fn character(ch: char) -> Literal {
10391039
let mut repr = String::new();
10401040
repr.push('\'');
1041-
if t == '"' {
1041+
if ch == '"' {
10421042
// escape_debug turns this into '\"' which is unnecessary.
1043-
repr.push(t);
1043+
repr.push(ch);
10441044
} else {
1045-
repr.extend(t.escape_debug());
1045+
repr.extend(ch.escape_debug());
10461046
}
10471047
repr.push('\'');
10481048
Literal::_new(repr)

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,8 +1240,8 @@ impl Literal {
12401240
}
12411241

12421242
/// Byte string literal.
1243-
pub fn byte_string(s: &[u8]) -> Literal {
1244-
Literal::_new(imp::Literal::byte_string(s))
1243+
pub fn byte_string(bytes: &[u8]) -> Literal {
1244+
Literal::_new(imp::Literal::byte_string(bytes))
12451245
}
12461246

12471247
/// Returns the span encompassing this literal.

src/wrapper.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -846,19 +846,19 @@ impl Literal {
846846
}
847847
}
848848

849-
pub fn string(t: &str) -> Literal {
849+
pub fn string(string: &str) -> Literal {
850850
if inside_proc_macro() {
851-
Literal::Compiler(proc_macro::Literal::string(t))
851+
Literal::Compiler(proc_macro::Literal::string(string))
852852
} else {
853-
Literal::Fallback(fallback::Literal::string(t))
853+
Literal::Fallback(fallback::Literal::string(string))
854854
}
855855
}
856856

857-
pub fn character(t: char) -> Literal {
857+
pub fn character(ch: char) -> Literal {
858858
if inside_proc_macro() {
859-
Literal::Compiler(proc_macro::Literal::character(t))
859+
Literal::Compiler(proc_macro::Literal::character(ch))
860860
} else {
861-
Literal::Fallback(fallback::Literal::character(t))
861+
Literal::Fallback(fallback::Literal::character(ch))
862862
}
863863
}
864864

0 commit comments

Comments
 (0)