1
Fork 0

Fallout from collection conventions

This commit is contained in:
Alexis Beingessner 2014-11-06 12:25:16 -05:00
parent cf3b2e4fe6
commit eec145be3f
101 changed files with 418 additions and 417 deletions

View file

@ -63,7 +63,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
()
});
with_used_diagnostics(|diagnostics| {
match diagnostics.swap(code.name, span) {
match diagnostics.insert(code.name, span) {
Some(previous_span) => {
ecx.span_warn(span, format!(
"diagnostic code {} already used", token::get_ident(code).get()
@ -93,7 +93,7 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
_ => unreachable!()
};
with_registered_diagnostics(|diagnostics| {
if !diagnostics.insert(code.name, description) {
if diagnostics.insert(code.name, description).is_some() {
ecx.span_err(span, format!(
"diagnostic code {} already registered", token::get_ident(*code).get()
).as_slice());