Skip to content

Commit

Permalink
Revert "Sorry for churn!"
Browse files Browse the repository at this point in the history
This reverts commit d64445d.
  • Loading branch information
hawkw committed Jan 5, 2018
1 parent d64445d commit 3824853
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ impl Scope {
/// which it is defined, pushing a module whose name is already defined
/// in this scope will cause this function to panic.
///
/// In many cases, the [`get_or_add_module`] function is preferrable, as it
/// will return the existing definition instead.
/// In many cases, the [`get_or_new_module`] function is preferrable, as it will
/// return the existing definition instead.
///
/// [`get_or_add_module`]: #method.get_or_add_module
/// [`get_or_new_module`]: #method.get_or_new_module
pub fn new_module(&mut self, name: &str) -> &mut Module {
self.push_module(Module::new(name));

Expand All @@ -319,7 +319,7 @@ impl Scope {

/// Returns a mutable reference to a module, creating it if it does
/// not exist.
pub fn get_or_add_module(&mut self, name: &str) -> &mut Module {
pub fn get_or_new_module(&mut self, name: &str) -> &mut Module {
if self.modules.contains_key(name) {
&mut self.modules[name]
} else {
Expand All @@ -335,10 +335,10 @@ impl Scope {
/// which it is defined, pushing a module whose name is already defined
/// in this scope will cause this function to panic.
///
/// In many cases, the [`get_or_add_module`] function is preferrable, as it
/// will return the existing definition instead.
/// In many cases, the [`get_or_new_module`] function is preferrable, as it will
/// return the existing definition instead.
///
/// [`get_or_add_module`]: #method.get_or_add_module
/// [`get_or_new_module`]: #method.get_or_new_module
pub fn push_module(&mut self, item: Module) -> &mut Self {
assert!(self.get_module(&item.name).is_none());
self.items.push(Item::Module(item.name.clone()));
Expand Down Expand Up @@ -553,10 +553,10 @@ impl Module {
/// which it is defined, pushing a module whose name is already defined
/// in this scope will cause this function to panic.
///
/// In many cases, the [`get_or_add_module`] function is preferrable, as it
/// will return the existing definition instead.
/// In many cases, the [`get_or_new_module`] function is preferrable, as it will
/// return the existing definition instead.
///
/// [`get_or_add_module`]: #method.get_or_add_module
/// [`get_or_new_module`]: #method.get_or_new_module
pub fn new_module(&mut self, name: &str) -> &mut Module {
self.scope.new_module(name)
}
Expand All @@ -581,8 +581,8 @@ impl Module {

/// Returns a mutable reference to a module, creating it if it does
/// not exist.
pub fn get_or_add_module(&mut self, name: &str) -> &mut Module {
self.scope.get_or_add_module(name)
pub fn get_or_new_module(&mut self, name: &str) -> &mut Module {
self.scope.get_or_new_module(name)
}

/// Push a module definition.
Expand All @@ -593,10 +593,10 @@ impl Module {
/// which it is defined, pushing a module whose name is already defined
/// in this scope will cause this function to panic.
///
/// In many cases, the [`get_or_add_module`] function is preferrable, as it
/// will return the existing definition instead.
/// In many cases, the [`get_or_new_module`] function is preferrable, as it will
/// return the existing definition instead.
///
/// [`get_or_add_module`]: #method.get_or_add_module
/// [`get_or_new_module`]: #method.get_or_new_module
pub fn push_module(&mut self, item: Module) -> &mut Self {
self.scope.push_module(item);
self
Expand Down

0 comments on commit 3824853

Please sign in to comment.