Skip to content

Commit

Permalink
Remove all cargo warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpita-Jaiswal committed Nov 3, 2024
1 parent e84ccc4 commit d48245b
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions v0.5/fastn-core/src/config/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod read;

This comment has been minimized.

Copy link
@amitu

amitu Nov 4, 2024

Contributor

@Arpita-Jaiswal lets start using #[expect(dead_code)] variants (if they work), as that way when you start using the code you get an extra warning to remove the #[expect()] line. #[allow(dead_code)] can be used for one variable or type, but tomorrow if we start using it, but leave the #[allow(dead_code)], it will suppress warning for some other code where we would have fixed the warning by removing that dead code.

Just that at times #[expect()] doesn't work as expected, but it should be your go to method.

#[allow(dead_code)]
pub struct Config {
ds: Box<dyn fastn_lang::DS>,
sitemap: Sitemap,
Expand Down
1 change: 1 addition & 0 deletions v0.5/fastn-core/src/route.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code)]
// the router will depend on fastn-lang, but
pub enum Route {
NotFound,
Expand Down
5 changes: 3 additions & 2 deletions v0.5/fastn-lang/src/compiler/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code)]
pub struct Compiler {
unresolved:
std::collections::HashMap<fastn_section::Identifier, fastn_lang::unresolved::Definition>,
Expand All @@ -11,11 +12,11 @@ enum CompilerState {
}

impl Compiler {
pub fn compile(_source: &str, _name: &str) -> CompilerState {
fn compile(_source: &str, _name: &str) -> CompilerState {
todo!()
}

pub fn continue_after_documents(
fn continue_after_documents(
self,
_source: &str,
_documents: std::collections::HashMap<fastn_section::Span, &str>,
Expand Down
1 change: 1 addition & 0 deletions v0.5/fastn-section/src/parser/section_init.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[allow(dead_code)]
pub fn section_init(
scanner: &mut fastn_section::Scanner<fastn_section::Document>,
) -> Option<fastn_section::SectionInit> {
Expand Down
1 change: 1 addition & 0 deletions v0.5/fastn-section/src/parser/tes.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[allow(dead_code)]
pub fn tes(
scanner: &mut fastn_section::Scanner<fastn_section::Document>,
) -> Option<Vec<fastn_section::Tes>> {
Expand Down
1 change: 1 addition & 0 deletions v0.5/fastn-section/src/parser/visibility.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[allow(dead_code)]
pub fn visibility(
scanner: &mut fastn_section::Scanner<fastn_section::Document>,
) -> Option<fastn_section::Visibility> {
Expand Down
3 changes: 3 additions & 0 deletions v0.5/fastn-section/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,14 @@ pub fn extend_span(span: &mut Option<fastn_section::Span>, other: fastn_section:
}
}

#[allow(dead_code)]
pub fn extend_o_span(span: &mut Option<fastn_section::Span>, other: Option<fastn_section::Span>) {
if let Some(other) = other {
extend_span(span, other);
}
}

#[allow(dead_code)]
pub fn extend_spanned<T>(
span: &mut Option<fastn_section::Span>,
other: &fastn_section::Spanned<T>,
Expand All @@ -72,6 +74,7 @@ pub fn extend_spanned<T>(
}

impl fastn_section::Kind {
#[allow(dead_code)]
fn span(&self) -> fastn_section::Span {
todo!()
// let mut span = self.doc.clone();
Expand Down
1 change: 1 addition & 0 deletions v0.5/fastn-section/src/wiggin.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// calls `inner_ender` for all the embedded section inside section in the
/// list and then calls `ender` for the list itself
#[allow(dead_code)]
pub fn ender(
source: &str,
o: &mut fastn_section::Document,
Expand Down
14 changes: 7 additions & 7 deletions v0.5/fastn-static/src/ds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@ pub struct DS {}

#[async_trait::async_trait]
impl fastn_lang::DS for DS {
async fn source(&mut self, document: &str) -> fastn_lang::Result<String> {
async fn source(&mut self, _document: &str) -> fastn_lang::Result<String> {
todo!()
}

async fn unresolved(
&mut self,
qualified_identifier: &str,
_qualified_identifier: &str,
) -> fastn_lang::Result<fastn_lang::unresolved::Definition> {
todo!()
}

async fn resolved(
&mut self,
qualified_identifier: &str,
_qualified_identifier: &str,
) -> fastn_lang::Result<fastn_lang::resolved::Definition> {
todo!()
}

async fn add_resolved(
&mut self,
qualified_identifier: &str,
resolved: fastn_lang::resolved::Definition,
_qualified_identifier: &str,
_resolved: fastn_lang::resolved::Definition,
) -> fastn_lang::Result<()> {
todo!()
}

async fn unresolved_document(
&mut self,
document: &str,
_document: &str,
) -> fastn_lang::Result<Vec<fastn_lang::unresolved::Document>> {
todo!()
}

async fn resolved_document(
&mut self,
document: &str,
_document: &str,
) -> fastn_lang::Result<Vec<fastn_lang::resolved::Document>> {
todo!()
}
Expand Down
2 changes: 1 addition & 1 deletion v0.5/fastn/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fn main() {
let ds =
let _ds =
// read config here and pass to everyone?
// do common build stuff here
match fastn::commands::parse() {
Expand Down

0 comments on commit d48245b

Please sign in to comment.