Skip to content

Commit 90e65b2

Browse files
committed
Merge commit 'refs/pull/511/head' of github.com:servo/rust-url into 2.0
2 parents 77a1033 + 85bfa53 commit 90e65b2

File tree

3 files changed

+0
-33
lines changed

3 files changed

+0
-33
lines changed

src/lib.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,20 +210,6 @@ impl<'a> ParseOptions<'a> {
210210
self
211211
}
212212

213-
/// Call the provided function or closure on non-fatal parse errors, passing
214-
/// a static string description. This method is deprecated in favor of
215-
/// `syntax_violation_callback` and is implemented as an adaptor for the
216-
/// latter, passing the `SyntaxViolation` description. Only the last value
217-
/// passed to either method will be used by a parser.
218-
#[deprecated]
219-
pub fn log_syntax_violation(mut self, new: Option<&'a dyn Fn(&'static str)>) -> Self {
220-
self.violation_fn = match new {
221-
Some(f) => ViolationFn::OldFn(f),
222-
None => ViolationFn::NoOp
223-
};
224-
self
225-
}
226-
227213
/// Call the provided function or closure for a non-fatal `SyntaxViolation`
228214
/// when it occurs during parsing. Note that since the provided function is
229215
/// `Fn`, the caller might need to utilize _interior mutability_, such as with

src/parser.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ impl<'i> Iterator for Input<'i> {
272272
#[derive(Copy, Clone)]
273273
pub enum ViolationFn<'a> {
274274
NewFn(&'a (dyn Fn(SyntaxViolation) + 'a)),
275-
OldFn(&'a (dyn Fn(&'static str) + 'a)),
276275
NoOp
277276
}
278277

@@ -281,7 +280,6 @@ impl<'a> ViolationFn<'a> {
281280
pub fn call(self, v: SyntaxViolation) {
282281
match self {
283282
ViolationFn::NewFn(f) => f(v),
284-
ViolationFn::OldFn(f) => f(v.description()),
285283
ViolationFn::NoOp => {}
286284
}
287285
}
@@ -293,7 +291,6 @@ impl<'a> ViolationFn<'a> {
293291
{
294292
match self {
295293
ViolationFn::NewFn(f) => if test() { f(v) },
296-
ViolationFn::OldFn(f) => if test() { f(v.description()) },
297294
ViolationFn::NoOp => {} // avoid test
298295
}
299296
}
@@ -311,7 +308,6 @@ impl<'a> fmt::Debug for ViolationFn<'a> {
311308
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
312309
match *self {
313310
ViolationFn::NewFn(_) => write!(f, "NewFn(Fn(SyntaxViolation))"),
314-
ViolationFn::OldFn(_) => write!(f, "OldFn(Fn(&'static str))"),
315311
ViolationFn::NoOp => write!(f, "NoOp")
316312
}
317313
}

tests/unit.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -489,21 +489,6 @@ fn test_windows_unc_path() {
489489
assert!(url.is_err());
490490
}
491491

492-
// Test the now deprecated log_syntax_violation method for backward
493-
// compatibility
494-
#[test]
495-
#[allow(deprecated)]
496-
fn test_old_log_violation_option() {
497-
let violation = Cell::new(None);
498-
let url = Url::options()
499-
.log_syntax_violation(Some(&|s| violation.set(Some(s.to_owned()))))
500-
.parse("http:////mozilla.org:42").unwrap();
501-
assert_eq!(url.port(), Some(42));
502-
503-
let violation = violation.take();
504-
assert_eq!(violation, Some("expected //".to_string()));
505-
}
506-
507492
#[test]
508493
fn test_syntax_violation_callback() {
509494
use url::SyntaxViolation::*;

0 commit comments

Comments
 (0)