Skip to content

Commit

Permalink
change unnaply return types. use Some instead of Option if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Nov 27, 2020
1 parent 9cd3e6e commit 6f1266f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/info.folone/scala.poi/Cell.scala
Expand Up @@ -25,7 +25,7 @@ class FormulaCell(override val index: Int, val data: String) extends Cell(index,
object FormulaCell {
def apply(index: Int, data: String): FormulaCell =
new FormulaCell(index, data.dropWhile(_ == '='))
def unapply(cell: FormulaCell): Option[(Int, String)] = Some((cell.index, cell.data))
def unapply(cell: FormulaCell): Some[(Int, String)] = Some((cell.index, cell.data))
}
class StyledCell private (override val index: Int, override val style: Option[CellStyle], val nestedCell: Cell)
extends Cell(index, style) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/info.folone/scala.poi/Row.scala
Expand Up @@ -18,5 +18,5 @@ class Row(val index: Int)(val cells: Set[Cell]) {

object Row {
def apply(index: Int)(cells: Set[Cell]): Row = new Row(index)(cells)
def unapply(row: Row): Option[(Int, Set[Cell])] = Some((row.index, row.cells))
def unapply(row: Row): Some[(Int, Set[Cell])] = Some((row.index, row.cells))
}
2 changes: 1 addition & 1 deletion src/main/scala/info.folone/scala.poi/Sheet.scala
Expand Up @@ -17,5 +17,5 @@ class Sheet(val name: String)(val rows: Set[Row]) {
}
object Sheet {
def apply(name: String)(rows: Set[Row]): Sheet = new Sheet(name)(rows)
def unapply(sheet: Sheet): Option[(String, Set[Row])] = Some((sheet.name, sheet.rows))
def unapply(sheet: Sheet): Some[(String, Set[Row])] = Some((sheet.name, sheet.rows))
}

0 comments on commit 6f1266f

Please sign in to comment.