mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-13 05:31:02 +00:00
Simplify the return types
This commit is contained in:
+3
-3
@@ -19,7 +19,7 @@ impl<W> Serializer<W>
|
|||||||
{
|
{
|
||||||
/// Creates a new JSON serializer.
|
/// Creates a new JSON serializer.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(writer: W) -> Serializer<W> {
|
pub fn new(writer: W) -> Self {
|
||||||
Serializer::with_formatter(writer, CompactFormatter)
|
Serializer::with_formatter(writer, CompactFormatter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ impl<W> Serializer<W, PrettyFormatter<'static>>
|
|||||||
{
|
{
|
||||||
/// Creates a new JSON pretty print serializer.
|
/// Creates a new JSON pretty print serializer.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn pretty(writer: W) -> Serializer<W, PrettyFormatter<'static>> {
|
pub fn pretty(writer: W) -> Self {
|
||||||
Serializer::with_formatter(writer, PrettyFormatter::new())
|
Serializer::with_formatter(writer, PrettyFormatter::new())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ impl<W, F> Serializer<W, F>
|
|||||||
/// Creates a new JSON visitor whose output will be written to the writer
|
/// Creates a new JSON visitor whose output will be written to the writer
|
||||||
/// specified.
|
/// specified.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn with_formatter(writer: W, formatter: F) -> Serializer<W, F> {
|
pub fn with_formatter(writer: W, formatter: F) -> Self {
|
||||||
Serializer {
|
Serializer {
|
||||||
writer: writer,
|
writer: writer,
|
||||||
formatter: formatter,
|
formatter: formatter,
|
||||||
|
|||||||
Reference in New Issue
Block a user