Skip to content

Commit d9ca8ba

Browse files
committed
chore: fix format
1 parent d43cacf commit d9ca8ba

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

scripts/fmt_fix.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
7+
8+
cd "${REPO_ROOT}"
9+
10+
echo "Updating Rust toolchain..."
11+
rustup update
12+
13+
if [[ "${1:-}" == "--check" ]]; then
14+
cargo fmt --all -- --check
15+
else
16+
cargo fmt --all
17+
fi
18+

src/serde/ser.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ where
7171
}
7272

7373
/// Enable sorting map keys before serialization.
74-
///
74+
///
7575
/// # Examples
7676
/// ```
7777
/// use serde::Serialize;
@@ -787,10 +787,9 @@ where
787787
let key = next_key
788788
.take()
789789
.expect("serialize_value called before serialize_key");
790-
let mut entry_ser = Serializer::with_formatter(
791-
Vec::with_capacity(128),
792-
ser.formatter.clone(),
793-
).with_cfg(ser.cfg);
790+
let mut entry_ser =
791+
Serializer::with_formatter(Vec::with_capacity(128), ser.formatter.clone())
792+
.with_cfg(ser.cfg);
794793
tri!(value.serialize(&mut entry_ser));
795794
let stored = entry_ser.into_inner();
796795
entries.push((key, stored));

src/value/ser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ mod test {
867867
use std::collections::HashMap;
868868

869869
use serde::{Deserialize, Serialize};
870+
870871
use crate::{to_value, Value};
871872

872873
#[derive(Debug, serde::Serialize, Hash, Default, Eq, PartialEq)]
@@ -878,7 +879,6 @@ mod test {
878879

879880
#[test]
880881
fn test_to_value() {
881-
882882
let user = User {
883883
string: "hello".into(),
884884
number: 123,

0 commit comments

Comments
 (0)