Update scalariform (#23778) (#23783)

This commit is contained in:
Arnout Engelen 2017-10-06 10:30:28 +02:00 committed by GitHub
parent 63ccdeec16
commit b1df13d4d4
221 changed files with 1528 additions and 1580 deletions

View file

@ -70,16 +70,16 @@ package docs.serialization {
// Use `""` if manifest is not needed.
def manifest(obj: AnyRef): String =
obj match {
case _: Customer => CustomerManifest
case _: User => UserManifest
case _: Customer CustomerManifest
case _: User UserManifest
}
// "toBinary" serializes the given object to an Array of Bytes
def toBinary(obj: AnyRef): Array[Byte] = {
// Put the real code that serializes the object here
obj match {
case Customer(name) => name.getBytes(UTF_8)
case User(name) => name.getBytes(UTF_8)
case Customer(name) name.getBytes(UTF_8)
case User(name) name.getBytes(UTF_8)
}
}
@ -88,9 +88,9 @@ package docs.serialization {
def fromBinary(bytes: Array[Byte], manifest: String): AnyRef = {
// Put the real code that deserializes here
manifest match {
case CustomerManifest =>
case CustomerManifest
Customer(new String(bytes, UTF_8))
case UserManifest =>
case UserManifest
User(new String(bytes, UTF_8))
}
}