Skip to content

Commit f9d3570

Browse files
committed
Fix typo: Rename PGEscapse to PGEscape
1 parent 9990141 commit f9d3570

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/database.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ fn get_missing_from_db(client: &mut Client, missing_sgs: &[i64]) -> BTreeMap<i64
164164
}
165165

166166
/// Helper function that escapes the wrapped text when writing SQL
167-
pub struct PGEscapse<'a>(pub &'a str);
167+
pub struct PGEscape<'a>(pub &'a str);
168168

169-
impl<'a> fmt::Display for PGEscapse<'a> {
169+
impl<'a> fmt::Display for PGEscape<'a> {
170170
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
171171
let mut delim = Cow::from("$$");
172172
while self.0.contains(&delim as &str) {
@@ -181,12 +181,12 @@ impl<'a> fmt::Display for PGEscapse<'a> {
181181

182182
#[test]
183183
fn test_pg_escape() {
184-
let s = format!("{}", PGEscapse("test"));
184+
let s = format!("{}", PGEscape("test"));
185185
assert_eq!(s, "$$test$$");
186186

187187
let dodgy_string = "test$$ing";
188188

189-
let s = format!("{}", PGEscapse(dodgy_string));
189+
let s = format!("{}", PGEscape(dodgy_string));
190190

191191
// prefix and suffixes should match
192192
let start_pos = s.find(dodgy_string).expect("expected to find dodgy string");

src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mod database;
2323
static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;
2424

2525
use compressor::Compressor;
26-
use database::PGEscapse;
26+
use database::PGEscape;
2727

2828
use clap::{
2929
crate_authors, crate_description, crate_name, crate_version, value_t_or_exit, App, Arg,
@@ -269,10 +269,10 @@ fn main() {
269269
output,
270270
"({}, {}, {}, {}, {})",
271271
sg,
272-
PGEscapse(room_id),
273-
PGEscapse(t),
274-
PGEscapse(s),
275-
PGEscapse(e)
272+
PGEscape(room_id),
273+
PGEscape(t),
274+
PGEscape(s),
275+
PGEscape(e)
276276
)
277277
.unwrap();
278278
}

0 commit comments

Comments
 (0)