Skip to content

Commit

Permalink
ref: Re-export SelectionType
Browse files Browse the repository at this point in the history
Signed-off-by: Shinyzenith <[email protected]>
  • Loading branch information
Shinyzenith committed Apr 7, 2024
1 parent 051b54a commit 8365535
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libwaysip/examples/base.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use libwaysip::{get_area, state::SelectionType};
use libwaysip::{get_area, SelectionType};
fn main() {
println!("{:?}", get_area(SelectionType::Area));
}
3 changes: 2 additions & 1 deletion libwaysip/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub mod error;
pub mod state;

use error::WaySipError;
pub use state::SelectionType;
use std::os::unix::prelude::AsFd;
use wayland_client::{
globals::registry_queue_init,
Expand Down Expand Up @@ -35,7 +36,7 @@ fn get_cursor_buffer(connection: &Connection, shm: &WlShm) -> Option<CursorImage
}

/// get the selected area
pub fn get_area(kind: state::SelectionType) -> Result<Option<state::AreaInfo>, WaySipError> {
pub fn get_area(kind: SelectionType) -> Result<Option<state::AreaInfo>, WaySipError> {
let connection =
Connection::connect_to_env().map_err(|e| WaySipError::InitFailed(e.to_string()))?;
let (globals, _) = registry_queue_init::<state::WaysipState>(&connection)
Expand Down
2 changes: 1 addition & 1 deletion waysip/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use clap::Parser;
use libwaysip::{get_area, state::SelectionType};
use libwaysip::{get_area, SelectionType};
use std::str::FromStr;

#[derive(Debug, Parser)]
Expand Down

0 comments on commit 8365535

Please sign in to comment.