Skip to content

Commit 2ebb9b5

Browse files
committed
hocus pocus docus existus
1 parent 9fa8fb1 commit 2ebb9b5

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/app.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub enum Page {
2323
ClipboardHistory,
2424
}
2525

26+
/// The types of arrow keys
2627
#[allow(dead_code)]
2728
#[derive(Debug, Clone)]
2829
pub enum ArrowKey {
@@ -32,6 +33,7 @@ pub enum ArrowKey {
3233
Right,
3334
}
3435

36+
/// The ways the cursor can move when a key is pressed
3537
#[derive(Debug, Clone)]
3638
pub enum Move {
3739
Back,

src/app/tile.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,22 @@ impl Drop for ExtSender {
4141
fn drop(&mut self) {}
4242
}
4343

44+
/// All the indexed apps that rustcast can search for
4445
#[derive(Clone, Debug)]
4546
struct AppIndex {
4647
by_name: BTreeMap<String, App>,
4748
}
4849

4950
impl AppIndex {
51+
/// Search for an element in the index that starts with the provided prefix
5052
fn search_prefix<'a>(&'a self, prefix: &'a str) -> impl Iterator<Item = &'a App> + 'a {
5153
self.by_name
5254
.range(prefix.to_string()..) // start at prefix
5355
.take_while(move |(k, _)| k.starts_with(prefix))
5456
.map(|(_, v)| v)
5557
}
5658

59+
/// Factory function for creating
5760
pub fn from_apps(options: Vec<App>) -> Self {
5861
let mut bmap = BTreeMap::new();
5962
for app in options {

src/utils.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ pub(crate) fn get_installed_apps(dir: impl AsRef<Path>, store_icons: bool) -> Ve
177177
.collect()
178178
}
179179

180+
/// Open the settings file with the system default editor
180181
pub fn open_settings() {
181182
thread::spawn(move || {
182183
NSWorkspace::new().openURL(&NSURL::fileURLWithPath(
@@ -188,6 +189,7 @@ pub fn open_settings() {
188189
});
189190
}
190191

192+
/// Open a provided URL (Platform specific)
191193
pub fn open_url(url: &str) {
192194
let url = url.to_owned();
193195
thread::spawn(move || {
@@ -198,6 +200,7 @@ pub fn open_url(url: &str) {
198200
});
199201
}
200202

203+
/// Check if the provided string is a valid url
201204
pub fn is_valid_url(s: &str) -> bool {
202205
s.ends_with(".com")
203206
|| s.ends_with(".net")

0 commit comments

Comments
 (0)