Skip to content

Commit

Permalink
FIXME
Browse files Browse the repository at this point in the history
  • Loading branch information
viperML committed Sep 2, 2024
1 parent 5dd64eb commit cf452aa
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/flake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
use std::fmt;

#[derive(Debug)]
enum Installable {
Flake(FlakeInstallable),
}

impl fmt::Display for Installable {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Installable::Flake(flake) => {
write!(f, "{}", flake.reference)?;

if !flake.attribute.is_empty() {
write!(f, "#")?;
}
}
}

Ok(())
}
}

#[derive(Debug)]
struct FlakeInstallable {
reference: String,
attribute: Vec<String>,
}
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mod clean;
mod commands;
mod completion;
mod flake;
mod home;
mod interface;
mod json;
Expand Down

0 comments on commit cf452aa

Please sign in to comment.