Skip to content

Commit

Permalink
very minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Ten0 committed Oct 20, 2024
1 parent 476cb22 commit 95a4a18
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
[workspace.lints.clippy]
explicit_auto_deref = "allow"
missing_safety_doc = "deny"
needless_lifetimes = "allow"
single_match = "allow"
tabs_in_doc_comments = "allow"
undocumented_unsafe_blocks = "deny"
Expand Down
6 changes: 3 additions & 3 deletions serde_avro_fast/src/schema/safe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl SchemaMut {
/// [`Schema`](crate::Schema) is necessary for use with the serializer and
/// deserializer.
///
/// This will fail if the schema is invalid (e.g. incorrect [`SchemaKey`]`).
/// This will fail if the schema is invalid (e.g. incorrect [`SchemaKey`]).
pub fn freeze(self) -> Result<super::Schema, SchemaError> {
self.try_into()
}
Expand Down Expand Up @@ -166,15 +166,15 @@ pub struct SchemaNode {
}

impl SchemaNode {
/// Build a new [`SchemaNode`] from the given regular type, with no logical
/// Build a `SchemaNode` from the given regular type, with no logical
/// type.
///
/// This is equivalent to `type_.into()`.
pub fn new(type_: RegularType) -> Self {
type_.into()
}

/// Build a new [`SchemaNode`] from the given regular type and logical type.
/// Build a `SchemaNode` from the given regular type and logical type.
pub fn with_logical_type(type_: RegularType, logical_type: LogicalType) -> Self {
Self {
type_,
Expand Down
2 changes: 1 addition & 1 deletion serde_avro_fast/src/schema/self_referential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ impl<'a> std::fmt::Debug for SchemaNode<'a> {
use std::cell::Cell;
struct SchemaNodeRenderingDepthGuard;
thread_local! {
static DEPTH: Cell<u32> = Cell::new(0);
static DEPTH: Cell<u32> = const { Cell::new(0) };
}
impl Drop for SchemaNodeRenderingDepthGuard {
fn drop(&mut self) {
Expand Down
2 changes: 1 addition & 1 deletion serde_avro_fast/src/ser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub struct SerializerConfig<'s> {
}

impl<'s> SerializerConfig<'s> {
/// Build a new `SerializerConfig` with a given `schema`, default options
/// Build a `SerializerConfig` with a given `schema`, default options
/// and empty serialization buffers.
///
/// The `schema` will be used when instantiating a serializer from this
Expand Down
2 changes: 1 addition & 1 deletion serde_avro_fast/src/ser/serializer/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ where
if !scale_to_write.is_empty() {
state
.writer
.write_all(&scale_to_write)
.write_all(scale_to_write)
.map_err(SerError::io)?;
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion serde_avro_fast/tests/round_trips.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ fn test_big_decimal() {

assert_eq!(
apache_avro::to_avro_datum(
&&apache_avro::Schema::BigDecimal,
&apache_avro::Schema::BigDecimal,
Value::BigDecimal("-0.2".parse().unwrap())
)
.unwrap(),
Expand Down

0 comments on commit 95a4a18

Please sign in to comment.