Skip to content

Commit

Permalink
Added build script
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianLondon committed Sep 2, 2024
1 parent ab698d4 commit a84db4a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct City {
lon: f32,
}

let mut file = File::open("cities.txt");
let mut file = File::open("cities.txt")?;
let cities: Vec<City> = City::read_fixed_all(file).map(|res| match res {
Ok(city) => city,
Err(err) => {
Expand Down
20 changes: 20 additions & 0 deletions build.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env nu

def "main docs" [] {
cargo +nightly docs-rs
if $env.LAST_EXIT_CODE != 0 {
print "docs-rs build failed"
exit 1
} else {
cargo doc --no-deps --all-features
cd fixcol-derive
cargo doc --no-deps --document-private-items
}
}

def "main test" [] {
cargo test --workspace -- --include-ignored
cargo test --workspace --features experimental-write -- --include-ignored
}

def main [] {}
2 changes: 1 addition & 1 deletion fixcol-derive/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Fixcol Derive

This crate, `fixcol-derive` contains the proc-macro derive functionality for
the [`fixcol`](../fixcol) crate. Unless you are planning on contributing to
the [`fixcol`](https://crates.io/crates/fixcol) crate. Unless you are planning on contributing to
`fixcol`, you probably want one of the following.

- [Crate](https://crates.io/crates/fixcol)
Expand Down
12 changes: 6 additions & 6 deletions fixcol-derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//! A proc macro crate for deriving [`ReadFixed`] and [`WriteFixed`]
//!
//! This crate, `fixcol-derive` contains the proc-macro derive functionality for
//! the [`fixcol`](../fixcol) crate. Unless you are planning on contributing to
//! `fixcol`, you probably want one of the following.
//! the [`fixcol`](https://docs.rs/fixcol/latest/fixcol/) crate. Unless you are
//! planning on contributing to `fixcol`, you probably want one of the following.
//!
//! - [Crate](https://crates.io/crates/fixcol)
//! - [Documentation](https://docs.rs/fixcol/latest/fixcol)
//! - [Repository](https://github.com/BrianLondon/fixcol)
//!
//! [`ReadFixed`]: fixcol::ReadFixed
//! [`WriteFixed`]: fixcol::WriteFixed
//! [`ReadFixed`]: https://docs.rs/fixcol/latest/fixcol/trait.ReadFixed.html
//! [`WriteFixed`]: https://docs.rs/fixcol/latest/fixcol/trait.WriteFixed.html
mod attrs;
mod enums;
mod error;
Expand All @@ -35,7 +35,7 @@ use crate::structs::{struct_read, struct_write};
///
/// See documentation on [`ReadFixed`] for a full description.
///
/// [`ReadFixed`]: fixcol::ReadFixed
/// [`ReadFixed`]: https://docs.rs/fixcol/latest/fixcol/trait.ReadFixed.html
#[proc_macro_derive(ReadFixed, attributes(fixcol))]
pub fn read_fixed_impl(input: TokenStream) -> TokenStream {
let ast: DeriveInput = syn::parse(input).unwrap();
Expand Down Expand Up @@ -73,7 +73,7 @@ pub fn read_fixed_impl(input: TokenStream) -> TokenStream {
///
/// See [`WriteFixed`] for a complete discuassion.
///
/// [`WriteFixed`]: fixcol::WriteFixed
/// [`WriteFixed`]: https://docs.rs/fixcol/latest/fixcol/trait.WriteFixed.html
#[proc_macro_derive(WriteFixed, attributes(fixcol))]
pub fn write_fixed_impl(input: TokenStream) -> TokenStream {
let ast: DeriveInput = syn::parse(input).unwrap();
Expand Down
1 change: 0 additions & 1 deletion src/fixcol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::error::Error;
/// using the proc macro, which offers full string and integer support and
/// limited floating point formatting.
#[cfg(feature = "experimental-write")]
// #[cfg(any(feature = "experimental-write", doc))]
pub trait WriteFixed {
/// Writes the object into the supplied buffer
///
Expand Down

0 comments on commit a84db4a

Please sign in to comment.