Skip to content

Commit

Permalink
Removed View from public
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Nov 22, 2021
1 parent 78c51fb commit b177bfd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/core/application.rs
Expand Up @@ -25,10 +25,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
use super::{Subscription, WrappedComponent};
use super::{Subscription, View, WrappedComponent};
use crate::listener::{EventListener, EventListenerCfg, ListenerError};
use crate::tui::layout::Rect;
use crate::{AttrValue, Attribute, Event, Frame, State, Sub, SubEventClause, View, ViewError};
use crate::{AttrValue, Attribute, Event, Frame, State, Sub, SubEventClause, ViewError};

use std::hash::Hash;
use std::time::{Duration, Instant};
Expand Down
19 changes: 0 additions & 19 deletions src/core/view.rs
Expand Up @@ -126,21 +126,6 @@ where
Ok(())
}

/// ### remount
///
/// Remount component. The component will be first umounted and then mounted.
/// Returns error if could not mount it, while it ignores whether the component was previously mounted.
pub fn remount(
&mut self,
id: K,
component: WrappedComponent<Msg, UserEvent>,
) -> ViewResult<()> {
if self.mounted(&id) {
self.umount(&id)?;
}
self.mount(id, component)
}

/// ### mounted
///
/// Returns whether component `id` is mounted
Expand Down Expand Up @@ -361,10 +346,6 @@ mod test {
assert!(view.component(&MockComponentId::InputFoo).is_some());
assert!(view.component(&MockComponentId::InputBar).is_none());
assert_eq!(view.mounted(&MockComponentId::InputBar), false);
// Remount
assert!(view
.remount(MockComponentId::InputFoo, Box::new(MockFooInput::default()))
.is_ok());
// Mount bar
assert!(view
.mount(MockComponentId::InputBar, Box::new(MockBarInput::default()))
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -110,7 +110,7 @@ pub use self::core::command;
pub use self::core::event::{self, Event, NoUserEvent};
pub use self::core::props::{self, AttrValue, Attribute, Props};
pub use self::core::subscription::{EventClause as SubEventClause, Sub, SubClause};
pub use self::core::{Component, MockComponent, State, StateValue, Update, View, ViewError};
pub use self::core::{Component, MockComponent, State, StateValue, Update, ViewError};
pub use adapter::{Frame, Terminal};
pub use listener::{EventListenerCfg, ListenerError};

Expand Down

0 comments on commit b177bfd

Please sign in to comment.