Skip to content

Commit

Permalink
Remove some dead functions
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPickering committed Jun 4, 2024
1 parent 913318d commit da77fd2
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 31 deletions.
8 changes: 0 additions & 8 deletions src/collection/recipe_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,6 @@ impl RecipeNode {
}
}

/// Get a presentable name for this folder/recipe
pub fn name(&self) -> &str {
match self {
RecipeNode::Folder(folder) => folder.name(),
RecipeNode::Recipe(recipe) => recipe.name(),
}
}

/// If this node is a recipe, return it. Otherwise return `None`
pub fn recipe(&self) -> Option<&Recipe> {
match self {
Expand Down
9 changes: 5 additions & 4 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,6 @@ pub struct CollectionDatabase {
}

impl CollectionDatabase {
pub fn collection_id(&self) -> CollectionId {
self.collection_id
}

/// Get the full path for the collection file associated with this DB handle
pub fn collection_path(&self) -> anyhow::Result<PathBuf> {
self.database
Expand Down Expand Up @@ -490,6 +486,11 @@ impl CollectionDatabase {
.traced()?;
Ok(())
}

#[cfg(test)]
pub fn collection_id(&self) -> CollectionId {
self.collection_id
}
}

/// Create an in-memory DB, only for testing
Expand Down
7 changes: 0 additions & 7 deletions src/http/content_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ impl ContentType {
const EXTENSIONS: Mapping<'static, ContentType> =
Mapping::new(&[(Self::Json, &["json"])]);

/// Get the file extension associated with this content type. For content
/// types that have multiple common extensions (e.g. `image/jpeg` has `jpeg`
/// and `jpg`), return whichever is defined first in the mapping.
pub fn extension(&self) -> &'static str {
Self::EXTENSIONS.get_label(*self)
}

/// Get MIME corresponding to this content type. Each content type maps to a
/// single MIME (although the reverse is not true)
pub fn mime(&self) -> Mime {
Expand Down
6 changes: 0 additions & 6 deletions src/http/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,12 +395,6 @@ impl ResponseRecord {
Some(format!("data.{}", mime.subtype()))
})
}

/// Get the content type of this response, based on the `Content-Type`
/// header. Return `None` if the header is missing or an unknown type.
pub fn content_type(&self) -> Option<ContentType> {
ContentType::from_response(self).ok()
}
}

/// HTTP response body. Content is stored as bytes because it may not
Expand Down
2 changes: 1 addition & 1 deletion src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl Template {
/// impossible (either type state or a runtime check), but it's not worth
/// the extra code for something that is very unlikely to happen. It says
/// "dangerous", don't be stupid.
pub(crate) fn dangerous(template: String) -> Self {
pub fn dangerous(template: String) -> Self {
// Create one raw chunk for everything
let chunk = TemplateInputChunk::Raw(Span::new(0, template.len()));
Self {
Expand Down
5 changes: 0 additions & 5 deletions src/tui/view/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,6 @@ impl RequestState {
}
}

/// Is the initial stage in a request life cycle?
pub fn is_initial(&self) -> bool {
matches!(self, Self::Building { .. })
}

/// Create a loading state with the current timestamp. This will generally
/// be slightly off from when the request was actually launched, but it
/// shouldn't matter. See [crate::http::RequestTicket::send] for why it
Expand Down

0 comments on commit da77fd2

Please sign in to comment.