Skip to content

Commit 183a32a

Browse files
chore: remove unused moshi functions.
1 parent 826e902 commit 183a32a

File tree

1 file changed

+1
-30
lines changed
  • src/main/kotlin/com/autonomousapps/internal/utils

1 file changed

+1
-30
lines changed

src/main/kotlin/com/autonomousapps/internal/utils/moshi.kt

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import java.io.File
1919
import kotlin.io.use
2020

2121
const val noJsonIndent = ""
22-
const val prettyJsonIndent = " "
2322

2423
val MOSHI: Moshi by lazy {
2524
Moshi.Builder()
@@ -32,7 +31,7 @@ val MOSHI: Moshi by lazy {
3231

3332
inline fun <reified T> JsonAdapter<T>.withNulls(withNulls: Boolean): JsonAdapter<T> {
3433
return if (withNulls) {
35-
this.serializeNulls()
34+
serializeNulls()
3635
} else {
3736
this
3837
}
@@ -97,14 +96,6 @@ inline fun <reified K, reified V> BufferedSource.fromJsonMapSet(): Map<K, Set<V>
9796
return getJsonMapSetAdapter<K, V>().fromJson(this)!!
9897
}
9998

100-
inline fun <reified T> T.toPrettyString(withNulls: Boolean = false): String {
101-
return getJsonAdapter<T>(withNulls).indent(prettyJsonIndent).toJson(this)
102-
}
103-
104-
inline fun <reified K, reified V> Map<K, V>.toPrettyString(withNulls: Boolean = false): String {
105-
return getJsonMapAdapter<K, V>(withNulls).indent(prettyJsonIndent).toJson(this)
106-
}
107-
10899
/**
109100
* Buffers writes of the set to disk, using the indent to make the output human-readable.
110101
* By default, the output is compacted.
@@ -135,16 +126,6 @@ inline fun <reified K, reified V> File.bufferWriteJsonMapSet(set: Map<K, Set<V>>
135126
}
136127
}
137128

138-
/**
139-
* Buffers pretty writes of the set to disk, using the indent to make the output human-readable.
140-
* By default, the output is compacted.
141-
*
142-
* @param set The set to write to file
143-
*/
144-
inline fun <reified T> File.bufferPrettyWriteJsonList(set: List<T>) {
145-
bufferWriteJsonList(set, prettyJsonIndent)
146-
}
147-
148129
/**
149130
* Buffers writes of the set to disk, using the indent to make the output human-readable.
150131
* By default, the output is compacted.
@@ -158,16 +139,6 @@ inline fun <reified T> File.bufferWriteJsonList(set: List<T>, indent: String = n
158139
}
159140
}
160141

161-
/**
162-
* Buffers pretty writes of the set to disk, using the indent to make the output human-readable.
163-
* By default, the output is compacted.
164-
*
165-
* @param set The set to write to file
166-
*/
167-
inline fun <reified T> File.bufferPrettyWriteJsonSet(set: Set<T>) {
168-
bufferWriteJsonSet(set, prettyJsonIndent)
169-
}
170-
171142
/**
172143
* Buffers writes of the set to disk, using the indent to make the output human-readable.
173144
* By default, the output is compacted.

0 commit comments

Comments
 (0)