Skip to content

Commit

Permalink
fix up new lints and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Mar 28, 2024
1 parent ec2d7f7 commit d330e74
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 5 deletions.
6 changes: 5 additions & 1 deletion buffer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ Rather than conditionally compile these methods, this library stubs
out functionality when an allocator isn't available.
*/

#![cfg_attr(not(test), no_std)]
#![no_std]
#![deny(missing_docs)]

mod error;

#[cfg(feature = "std")]
#[macro_use]
#[allow(unused_imports)]
extern crate std as libstd;

#[cfg(not(feature = "alloc"))]
extern crate core as std;

#[cfg(any(test, feature = "alloc"))]
#[macro_use]
#[allow(unused_imports)]
extern crate alloc;
#[cfg(feature = "alloc")]
extern crate core;
Expand Down
2 changes: 2 additions & 0 deletions buffer/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1790,6 +1790,8 @@ mod tests {
mod alloc_tests {
use super::*;

use crate::std::string::String;

use sval::Stream as _;
use sval_derive_macros::*;

Expand Down
2 changes: 2 additions & 0 deletions derive/test/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ mod derive_tuple {

#[test]
fn skip() {
#[allow(dead_code)]
#[derive(Value)]
struct Tuple(#[sval(skip)] i32, i32);

Expand Down Expand Up @@ -1045,6 +1046,7 @@ mod derive_enum {
#[test]
fn skip() {
#[derive(Value)]
#[allow(dead_code)]
enum Enum {
Record {
#[sval(skip)]
Expand Down
1 change: 0 additions & 1 deletion flatten/src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ impl<'sval, S: Stream<'sval>> Stream<'sval> for PassThru<S> {

#[cfg(test)]
mod tests {
use alloc::borrow::ToOwned;
use sval_derive_macros::*;

use super::*;
Expand Down
4 changes: 2 additions & 2 deletions fmt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ that formats it using the same output that you'd get if you
derived [`core::fmt::Debug`].
*/

#![cfg_attr(not(test), no_std)]
#![no_std]
#![deny(missing_docs)]

#[cfg(feature = "alloc")]
#[cfg(any(test, feature = "alloc"))]
extern crate alloc;

mod writer;
Expand Down
2 changes: 2 additions & 0 deletions fmt/src/token_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,8 @@ impl<'a, W: TokenWrite + ?Sized> TokenWrite for &'a mut W {
mod tests {
use super::*;

use alloc::string::String;

#[test]
fn escape_debug() {
let cases = [
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ The [`Value`] and [`Stream`] traits aren't object-safe themselves, but object-sa
wrappers are provided by the `sval_dynamic` crate. This wrapper works in no-std.
*/

#![cfg_attr(not(test), no_std)]
#![no_std]
#![deny(missing_docs)]

#[cfg(feature = "std")]
Expand Down

0 comments on commit d330e74

Please sign in to comment.