Skip to content

Commit da58a32

Browse files
committed
unindent code blocks
1 parent 10b3783 commit da58a32

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

README.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,80 +21,80 @@ libraryDependencies += "com.github.dwickern" %% "scala-nameof" % "3.0.0" % "prov
2121

2222
Now you can use `nameOf` to get the name of a variable or class member:
2323
```scala mdoc:nest
24-
import com.github.dwickern.macros.NameOf._
24+
import com.github.dwickern.macros.NameOf._
2525

26-
case class Person(name: String, age: Int)
26+
case class Person(name: String, age: Int)
2727

28-
def toMap(person: Person) = Map(
29-
nameOf(person.name) -> person.name,
30-
nameOf(person.age) -> person.age
31-
)
28+
def toMap(person: Person) = Map(
29+
nameOf(person.name) -> person.name,
30+
nameOf(person.age) -> person.age
31+
)
3232
```
3333
``` mdoc:nest
34-
// compiles to:
34+
// compiles to:
3535
36-
def toMap(person: Person) = Map(
37-
"name" -> person.name,
38-
"age" -> person.age
39-
)
36+
def toMap(person: Person) = Map(
37+
"name" -> person.name,
38+
"age" -> person.age
39+
)
4040
```
4141

4242
To get the name of a function:
4343
```scala mdoc:nest
44-
import com.github.dwickern.macros.NameOf._
44+
import com.github.dwickern.macros.NameOf._
4545

46-
def startCalculation(value: Int): Unit = {
47-
println("Entered " + nameOf(startCalculation _))
48-
}
46+
def startCalculation(value: Int): Unit = {
47+
println("Entered " + nameOf(startCalculation _))
48+
}
4949
```
5050
``` mdoc:nest
51-
// compiles to:
51+
// compiles to:
5252
53-
def startCalculation(value: Int): Unit = {
54-
println("Entered startCalculation")
55-
}
53+
def startCalculation(value: Int): Unit = {
54+
println("Entered startCalculation")
55+
}
5656
```
5757

5858
Without having an instance of the type:
5959
```scala mdoc:nest
60-
import com.github.dwickern.macros.NameOf._
61-
62-
case class Person(name: String, age: Int) {
63-
def sayHello(other: Person) = s"Hello ${other.name}!"
64-
}
65-
66-
println(nameOf[Person](_.age))
67-
println(nameOf[Person](_.sayHello(???)))
60+
import com.github.dwickern.macros.NameOf._
61+
62+
case class Person(name: String, age: Int) {
63+
def sayHello(other: Person) = s"Hello ${other.name}!"
64+
}
65+
66+
println(nameOf[Person](_.age))
67+
println(nameOf[Person](_.sayHello(???)))
6868
```
6969
``` mdoc:nest
70-
// compiles to:
71-
72-
println("age")
73-
println("sayHello")
70+
// compiles to:
71+
72+
println("age")
73+
println("sayHello")
7474
```
7575

7676
You can also use `nameOfType` to get the unqualified name of a type:
7777
```scala mdoc:nest
78-
import com.github.dwickern.macros.NameOf._
78+
import com.github.dwickern.macros.NameOf._
7979

80-
println(nameOfType[java.lang.String])
80+
println(nameOfType[java.lang.String])
8181
```
8282
``` mdoc:nest
83-
// compiles to:
83+
// compiles to:
8484
85-
println("String")
85+
println("String")
8686
```
8787

8888
And `qualifiedNameOfType` to get the qualified name:
8989
```scala mdoc:nest
90-
import com.github.dwickern.macros.NameOf._
90+
import com.github.dwickern.macros.NameOf._
9191

92-
println(qualifiedNameOfType[java.lang.String])
92+
println(qualifiedNameOfType[java.lang.String])
9393
```
9494
``` mdoc:nest
95-
// compiles to:
95+
// compiles to:
9696
97-
println("java.lang.String")
97+
println("java.lang.String")
9898
```
9999

100100

0 commit comments

Comments
 (0)