summaryrefslogtreecommitdiff
path: root/src/main/scala/chisel3/util/TransitName.scala
diff options
context:
space:
mode:
authorJack Koenig2022-01-10 16:32:51 -0800
committerGitHub2022-01-10 16:32:51 -0800
commit2b48fd15a7711dcd44334fbbc538667a102a581a (patch)
tree4b4766347c3943d65c13e5de2d139b14821eec61 /src/main/scala/chisel3/util/TransitName.scala
parent92e77a97af986629766ac9038f0ebc8ab9a48fa1 (diff)
parentbff8dc0738adafa1176f6959a33ad86f6373c558 (diff)
Merge pull request #2246 from chipsalliance/scalafmt
Add scalafmt configuration and apply it.
Diffstat (limited to 'src/main/scala/chisel3/util/TransitName.scala')
-rw-r--r--src/main/scala/chisel3/util/TransitName.scala13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/main/scala/chisel3/util/TransitName.scala b/src/main/scala/chisel3/util/TransitName.scala
index 97c13696..cc8f2456 100644
--- a/src/main/scala/chisel3/util/TransitName.scala
+++ b/src/main/scala/chisel3/util/TransitName.scala
@@ -42,24 +42,23 @@ object TransitName {
* @param to the thing that will receive the "good" name
* @return the `from` parameter
*/
- def apply[T<:HasId](from: T, to: HasId): T = {
+ def apply[T <: HasId](from: T, to: HasId): T = {
// To transit a name, we need to hook on both the suggestName and autoSeed mechanisms
- from.addSuggestPostnameHook((given_name: String) => {to.suggestName(given_name)})
- from.addAutoPostnameHook((given_name: String) => {to.autoSeed(given_name)})
+ from.addSuggestPostnameHook((given_name: String) => { to.suggestName(given_name) })
+ from.addAutoPostnameHook((given_name: String) => { to.autoSeed(given_name) })
from
}
-
/** Transit a name from one type to another ''and add a suffix''
* @param suffix the suffix to append
* @param from the thing with a "good" name
* @param to the thing that will receive the "good" name
* @return the `from` parameter
*/
- def withSuffix[T<:HasId](suffix: String)(from: T, to: HasId): T = {
+ def withSuffix[T <: HasId](suffix: String)(from: T, to: HasId): T = {
// To transit a name, we need to hook on both the suggestName and autoSeed mechanisms
- from.addSuggestPostnameHook((given_name: String) => {to.suggestName(given_name + suffix)})
- from.addAutoPostnameHook((given_name: String) => {to.autoSeed(given_name + suffix)})
+ from.addSuggestPostnameHook((given_name: String) => { to.suggestName(given_name + suffix) })
+ from.addAutoPostnameHook((given_name: String) => { to.autoSeed(given_name + suffix) })
from
}