Skip to content

Commit bd4291d

Browse files
committed
change namespace of scala.util.Using
to avoid any clashes in dowstream projects.
1 parent 9f86f4d commit bd4291d

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

os/src/TempOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package os
22

33
import java.nio.file.attribute.{FileAttribute, PosixFilePermissions}
4-
import scala.util.Using
4+
import os.util.Using
55

66
/**
77
* Create temporary files and directories. [[withFile]] and [[withDir]]

os/src-2.12-/Using.scala renamed to os/src/Using.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
/*
2+
* Verbatim copy of scala.util.Using - only copied here because we're also targeting
3+
* scala 2.12 and 2.11, which don't ship that by default. Changed the package to
4+
* os.util to avoid any clashes in dowstream projects.
5+
*
26
* Scala (https://www.scala-lang.org)
37
*
48
* Copyright EPFL and Lightbend, Inc.
@@ -10,8 +14,9 @@
1014
* additional information regarding copyright ownership.
1115
*/
1216

13-
package scala.util
17+
package os.util
1418

19+
import scala.util.Try
1520
import scala.util.control.{ControlThrowable, NonFatal}
1621

1722
/** A utility for performing automatic resource management. It can be used to perform an

os/test/src/TempPathTests.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package test.os
22

33
import os._
4-
import scala.util.Using
4+
// if running with scala 2.13+, this can be the regular `scala.util.Using`
5+
import os.util.Using
56
import utest.{assert => _, _}
67

78
object TempPathTests extends TestSuite{

0 commit comments

Comments
 (0)